
obj/user/yield.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 6d 00 00 00       	call   80009e <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:

#include <inc/lib.h>

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	53                   	push   %ebx
  80003b:	83 ec 0c             	sub    $0xc,%esp
	int i;

	cprintf("Hello, I am environment %08x.\n", thisenv->env_id);
  80003e:	a1 04 40 80 00       	mov    0x804004,%eax
  800043:	8b 40 48             	mov    0x48(%eax),%eax
  800046:	50                   	push   %eax
  800047:	68 20 1f 80 00       	push   $0x801f20
  80004c:	e8 5c 01 00 00       	call   8001ad <cprintf>
  800051:	83 c4 10             	add    $0x10,%esp
	for (i = 0; i < 5; i++) {
  800054:	bb 00 00 00 00       	mov    $0x0,%ebx
		sys_yield();
  800059:	e8 47 0b 00 00       	call   800ba5 <sys_yield>
		cprintf("Back in environment %08x, iteration %d.\n",
			thisenv->env_id, i);
  80005e:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("Back in environment %08x, iteration %d.\n",
  800063:	8b 40 48             	mov    0x48(%eax),%eax
  800066:	83 ec 04             	sub    $0x4,%esp
  800069:	53                   	push   %ebx
  80006a:	50                   	push   %eax
  80006b:	68 40 1f 80 00       	push   $0x801f40
  800070:	e8 38 01 00 00       	call   8001ad <cprintf>
	for (i = 0; i < 5; i++) {
  800075:	83 c3 01             	add    $0x1,%ebx
  800078:	83 c4 10             	add    $0x10,%esp
  80007b:	83 fb 05             	cmp    $0x5,%ebx
  80007e:	75 d9                	jne    800059 <umain+0x26>
	}
	cprintf("All done in environment %08x.\n", thisenv->env_id);
  800080:	a1 04 40 80 00       	mov    0x804004,%eax
  800085:	8b 40 48             	mov    0x48(%eax),%eax
  800088:	83 ec 08             	sub    $0x8,%esp
  80008b:	50                   	push   %eax
  80008c:	68 6c 1f 80 00       	push   $0x801f6c
  800091:	e8 17 01 00 00       	call   8001ad <cprintf>
}
  800096:	83 c4 10             	add    $0x10,%esp
  800099:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80009c:	c9                   	leave  
  80009d:	c3                   	ret    

0080009e <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  80009e:	f3 0f 1e fb          	endbr32 
  8000a2:	55                   	push   %ebp
  8000a3:	89 e5                	mov    %esp,%ebp
  8000a5:	56                   	push   %esi
  8000a6:	53                   	push   %ebx
  8000a7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  8000aa:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  8000ad:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  8000b4:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  8000b7:	e8 c6 0a 00 00       	call   800b82 <sys_getenvid>
  8000bc:	25 ff 03 00 00       	and    $0x3ff,%eax
  8000c1:	6b c0 7c             	imul   $0x7c,%eax,%eax
  8000c4:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  8000c9:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  8000ce:	85 db                	test   %ebx,%ebx
  8000d0:	7e 07                	jle    8000d9 <libmain+0x3b>
		binaryname = argv[0];
  8000d2:	8b 06                	mov    (%esi),%eax
  8000d4:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  8000d9:	83 ec 08             	sub    $0x8,%esp
  8000dc:	56                   	push   %esi
  8000dd:	53                   	push   %ebx
  8000de:	e8 50 ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  8000e3:	e8 0a 00 00 00       	call   8000f2 <exit>
}
  8000e8:	83 c4 10             	add    $0x10,%esp
  8000eb:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8000ee:	5b                   	pop    %ebx
  8000ef:	5e                   	pop    %esi
  8000f0:	5d                   	pop    %ebp
  8000f1:	c3                   	ret    

008000f2 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  8000f2:	f3 0f 1e fb          	endbr32 
  8000f6:	55                   	push   %ebp
  8000f7:	89 e5                	mov    %esp,%ebp
  8000f9:	83 ec 08             	sub    $0x8,%esp
	close_all();
  8000fc:	e8 c7 0e 00 00       	call   800fc8 <close_all>
	sys_env_destroy(0);
  800101:	83 ec 0c             	sub    $0xc,%esp
  800104:	6a 00                	push   $0x0
  800106:	e8 32 0a 00 00       	call   800b3d <sys_env_destroy>
}
  80010b:	83 c4 10             	add    $0x10,%esp
  80010e:	c9                   	leave  
  80010f:	c3                   	ret    

00800110 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  800110:	f3 0f 1e fb          	endbr32 
  800114:	55                   	push   %ebp
  800115:	89 e5                	mov    %esp,%ebp
  800117:	53                   	push   %ebx
  800118:	83 ec 04             	sub    $0x4,%esp
  80011b:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  80011e:	8b 13                	mov    (%ebx),%edx
  800120:	8d 42 01             	lea    0x1(%edx),%eax
  800123:	89 03                	mov    %eax,(%ebx)
  800125:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800128:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  80012c:	3d ff 00 00 00       	cmp    $0xff,%eax
  800131:	74 09                	je     80013c <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  800133:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  800137:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80013a:	c9                   	leave  
  80013b:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  80013c:	83 ec 08             	sub    $0x8,%esp
  80013f:	68 ff 00 00 00       	push   $0xff
  800144:	8d 43 08             	lea    0x8(%ebx),%eax
  800147:	50                   	push   %eax
  800148:	e8 ab 09 00 00       	call   800af8 <sys_cputs>
		b->idx = 0;
  80014d:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  800153:	83 c4 10             	add    $0x10,%esp
  800156:	eb db                	jmp    800133 <putch+0x23>

00800158 <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  800158:	f3 0f 1e fb          	endbr32 
  80015c:	55                   	push   %ebp
  80015d:	89 e5                	mov    %esp,%ebp
  80015f:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  800165:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  80016c:	00 00 00 
	b.cnt = 0;
  80016f:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  800176:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  800179:	ff 75 0c             	pushl  0xc(%ebp)
  80017c:	ff 75 08             	pushl  0x8(%ebp)
  80017f:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  800185:	50                   	push   %eax
  800186:	68 10 01 80 00       	push   $0x800110
  80018b:	e8 20 01 00 00       	call   8002b0 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800190:	83 c4 08             	add    $0x8,%esp
  800193:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  800199:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  80019f:	50                   	push   %eax
  8001a0:	e8 53 09 00 00       	call   800af8 <sys_cputs>

	return b.cnt;
}
  8001a5:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  8001ab:	c9                   	leave  
  8001ac:	c3                   	ret    

008001ad <cprintf>:

int
cprintf(const char *fmt, ...)
{
  8001ad:	f3 0f 1e fb          	endbr32 
  8001b1:	55                   	push   %ebp
  8001b2:	89 e5                	mov    %esp,%ebp
  8001b4:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  8001b7:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  8001ba:	50                   	push   %eax
  8001bb:	ff 75 08             	pushl  0x8(%ebp)
  8001be:	e8 95 ff ff ff       	call   800158 <vcprintf>
	va_end(ap);

	return cnt;
}
  8001c3:	c9                   	leave  
  8001c4:	c3                   	ret    

008001c5 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  8001c5:	55                   	push   %ebp
  8001c6:	89 e5                	mov    %esp,%ebp
  8001c8:	57                   	push   %edi
  8001c9:	56                   	push   %esi
  8001ca:	53                   	push   %ebx
  8001cb:	83 ec 1c             	sub    $0x1c,%esp
  8001ce:	89 c7                	mov    %eax,%edi
  8001d0:	89 d6                	mov    %edx,%esi
  8001d2:	8b 45 08             	mov    0x8(%ebp),%eax
  8001d5:	8b 55 0c             	mov    0xc(%ebp),%edx
  8001d8:	89 d1                	mov    %edx,%ecx
  8001da:	89 c2                	mov    %eax,%edx
  8001dc:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8001df:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8001e2:	8b 45 10             	mov    0x10(%ebp),%eax
  8001e5:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  8001e8:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8001eb:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8001f2:	39 c2                	cmp    %eax,%edx
  8001f4:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  8001f7:	72 3e                	jb     800237 <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  8001f9:	83 ec 0c             	sub    $0xc,%esp
  8001fc:	ff 75 18             	pushl  0x18(%ebp)
  8001ff:	83 eb 01             	sub    $0x1,%ebx
  800202:	53                   	push   %ebx
  800203:	50                   	push   %eax
  800204:	83 ec 08             	sub    $0x8,%esp
  800207:	ff 75 e4             	pushl  -0x1c(%ebp)
  80020a:	ff 75 e0             	pushl  -0x20(%ebp)
  80020d:	ff 75 dc             	pushl  -0x24(%ebp)
  800210:	ff 75 d8             	pushl  -0x28(%ebp)
  800213:	e8 a8 1a 00 00       	call   801cc0 <__udivdi3>
  800218:	83 c4 18             	add    $0x18,%esp
  80021b:	52                   	push   %edx
  80021c:	50                   	push   %eax
  80021d:	89 f2                	mov    %esi,%edx
  80021f:	89 f8                	mov    %edi,%eax
  800221:	e8 9f ff ff ff       	call   8001c5 <printnum>
  800226:	83 c4 20             	add    $0x20,%esp
  800229:	eb 13                	jmp    80023e <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  80022b:	83 ec 08             	sub    $0x8,%esp
  80022e:	56                   	push   %esi
  80022f:	ff 75 18             	pushl  0x18(%ebp)
  800232:	ff d7                	call   *%edi
  800234:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  800237:	83 eb 01             	sub    $0x1,%ebx
  80023a:	85 db                	test   %ebx,%ebx
  80023c:	7f ed                	jg     80022b <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  80023e:	83 ec 08             	sub    $0x8,%esp
  800241:	56                   	push   %esi
  800242:	83 ec 04             	sub    $0x4,%esp
  800245:	ff 75 e4             	pushl  -0x1c(%ebp)
  800248:	ff 75 e0             	pushl  -0x20(%ebp)
  80024b:	ff 75 dc             	pushl  -0x24(%ebp)
  80024e:	ff 75 d8             	pushl  -0x28(%ebp)
  800251:	e8 7a 1b 00 00       	call   801dd0 <__umoddi3>
  800256:	83 c4 14             	add    $0x14,%esp
  800259:	0f be 80 95 1f 80 00 	movsbl 0x801f95(%eax),%eax
  800260:	50                   	push   %eax
  800261:	ff d7                	call   *%edi
}
  800263:	83 c4 10             	add    $0x10,%esp
  800266:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800269:	5b                   	pop    %ebx
  80026a:	5e                   	pop    %esi
  80026b:	5f                   	pop    %edi
  80026c:	5d                   	pop    %ebp
  80026d:	c3                   	ret    

0080026e <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  80026e:	f3 0f 1e fb          	endbr32 
  800272:	55                   	push   %ebp
  800273:	89 e5                	mov    %esp,%ebp
  800275:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  800278:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  80027c:	8b 10                	mov    (%eax),%edx
  80027e:	3b 50 04             	cmp    0x4(%eax),%edx
  800281:	73 0a                	jae    80028d <sprintputch+0x1f>
		*b->buf++ = ch;
  800283:	8d 4a 01             	lea    0x1(%edx),%ecx
  800286:	89 08                	mov    %ecx,(%eax)
  800288:	8b 45 08             	mov    0x8(%ebp),%eax
  80028b:	88 02                	mov    %al,(%edx)
}
  80028d:	5d                   	pop    %ebp
  80028e:	c3                   	ret    

0080028f <printfmt>:
{
  80028f:	f3 0f 1e fb          	endbr32 
  800293:	55                   	push   %ebp
  800294:	89 e5                	mov    %esp,%ebp
  800296:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  800299:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  80029c:	50                   	push   %eax
  80029d:	ff 75 10             	pushl  0x10(%ebp)
  8002a0:	ff 75 0c             	pushl  0xc(%ebp)
  8002a3:	ff 75 08             	pushl  0x8(%ebp)
  8002a6:	e8 05 00 00 00       	call   8002b0 <vprintfmt>
}
  8002ab:	83 c4 10             	add    $0x10,%esp
  8002ae:	c9                   	leave  
  8002af:	c3                   	ret    

008002b0 <vprintfmt>:
{
  8002b0:	f3 0f 1e fb          	endbr32 
  8002b4:	55                   	push   %ebp
  8002b5:	89 e5                	mov    %esp,%ebp
  8002b7:	57                   	push   %edi
  8002b8:	56                   	push   %esi
  8002b9:	53                   	push   %ebx
  8002ba:	83 ec 3c             	sub    $0x3c,%esp
  8002bd:	8b 75 08             	mov    0x8(%ebp),%esi
  8002c0:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  8002c3:	8b 7d 10             	mov    0x10(%ebp),%edi
  8002c6:	e9 5d 03 00 00       	jmp    800628 <vprintfmt+0x378>
		padc = ' ';
  8002cb:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  8002cf:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  8002d6:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  8002dd:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  8002e4:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8002e9:	8d 47 01             	lea    0x1(%edi),%eax
  8002ec:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8002ef:	0f b6 17             	movzbl (%edi),%edx
  8002f2:	8d 42 dd             	lea    -0x23(%edx),%eax
  8002f5:	3c 55                	cmp    $0x55,%al
  8002f7:	0f 87 ae 03 00 00    	ja     8006ab <vprintfmt+0x3fb>
  8002fd:	0f b6 c0             	movzbl %al,%eax
  800300:	3e ff 24 85 e0 20 80 	notrack jmp *0x8020e0(,%eax,4)
  800307:	00 
  800308:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  80030b:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  80030f:	eb d8                	jmp    8002e9 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800311:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  800314:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  800318:	eb cf                	jmp    8002e9 <vprintfmt+0x39>
  80031a:	0f b6 d2             	movzbl %dl,%edx
  80031d:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  800320:	b8 00 00 00 00       	mov    $0x0,%eax
  800325:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  800328:	8d 04 80             	lea    (%eax,%eax,4),%eax
  80032b:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  80032f:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  800332:	8d 4a d0             	lea    -0x30(%edx),%ecx
  800335:	83 f9 09             	cmp    $0x9,%ecx
  800338:	77 55                	ja     80038f <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  80033a:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  80033d:	eb e9                	jmp    800328 <vprintfmt+0x78>
			precision = va_arg(ap, int);
  80033f:	8b 45 14             	mov    0x14(%ebp),%eax
  800342:	8b 00                	mov    (%eax),%eax
  800344:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800347:	8b 45 14             	mov    0x14(%ebp),%eax
  80034a:	8d 40 04             	lea    0x4(%eax),%eax
  80034d:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800350:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  800353:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  800357:	79 90                	jns    8002e9 <vprintfmt+0x39>
				width = precision, precision = -1;
  800359:	8b 45 d8             	mov    -0x28(%ebp),%eax
  80035c:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  80035f:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  800366:	eb 81                	jmp    8002e9 <vprintfmt+0x39>
  800368:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  80036b:	85 c0                	test   %eax,%eax
  80036d:	ba 00 00 00 00       	mov    $0x0,%edx
  800372:	0f 49 d0             	cmovns %eax,%edx
  800375:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800378:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80037b:	e9 69 ff ff ff       	jmp    8002e9 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800380:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800383:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  80038a:	e9 5a ff ff ff       	jmp    8002e9 <vprintfmt+0x39>
  80038f:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800392:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800395:	eb bc                	jmp    800353 <vprintfmt+0xa3>
			lflag++;
  800397:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80039a:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80039d:	e9 47 ff ff ff       	jmp    8002e9 <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  8003a2:	8b 45 14             	mov    0x14(%ebp),%eax
  8003a5:	8d 78 04             	lea    0x4(%eax),%edi
  8003a8:	83 ec 08             	sub    $0x8,%esp
  8003ab:	53                   	push   %ebx
  8003ac:	ff 30                	pushl  (%eax)
  8003ae:	ff d6                	call   *%esi
			break;
  8003b0:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  8003b3:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  8003b6:	e9 6a 02 00 00       	jmp    800625 <vprintfmt+0x375>
			err = va_arg(ap, int);
  8003bb:	8b 45 14             	mov    0x14(%ebp),%eax
  8003be:	8d 78 04             	lea    0x4(%eax),%edi
  8003c1:	8b 00                	mov    (%eax),%eax
  8003c3:	99                   	cltd   
  8003c4:	31 d0                	xor    %edx,%eax
  8003c6:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  8003c8:	83 f8 0f             	cmp    $0xf,%eax
  8003cb:	7f 23                	jg     8003f0 <vprintfmt+0x140>
  8003cd:	8b 14 85 40 22 80 00 	mov    0x802240(,%eax,4),%edx
  8003d4:	85 d2                	test   %edx,%edx
  8003d6:	74 18                	je     8003f0 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  8003d8:	52                   	push   %edx
  8003d9:	68 71 23 80 00       	push   $0x802371
  8003de:	53                   	push   %ebx
  8003df:	56                   	push   %esi
  8003e0:	e8 aa fe ff ff       	call   80028f <printfmt>
  8003e5:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003e8:	89 7d 14             	mov    %edi,0x14(%ebp)
  8003eb:	e9 35 02 00 00       	jmp    800625 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  8003f0:	50                   	push   %eax
  8003f1:	68 ad 1f 80 00       	push   $0x801fad
  8003f6:	53                   	push   %ebx
  8003f7:	56                   	push   %esi
  8003f8:	e8 92 fe ff ff       	call   80028f <printfmt>
  8003fd:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  800400:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  800403:	e9 1d 02 00 00       	jmp    800625 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  800408:	8b 45 14             	mov    0x14(%ebp),%eax
  80040b:	83 c0 04             	add    $0x4,%eax
  80040e:	89 45 c8             	mov    %eax,-0x38(%ebp)
  800411:	8b 45 14             	mov    0x14(%ebp),%eax
  800414:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  800416:	85 d2                	test   %edx,%edx
  800418:	b8 a6 1f 80 00       	mov    $0x801fa6,%eax
  80041d:	0f 45 c2             	cmovne %edx,%eax
  800420:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  800423:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  800427:	7e 06                	jle    80042f <vprintfmt+0x17f>
  800429:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  80042d:	75 0d                	jne    80043c <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  80042f:	8b 45 cc             	mov    -0x34(%ebp),%eax
  800432:	89 c7                	mov    %eax,%edi
  800434:	03 45 d4             	add    -0x2c(%ebp),%eax
  800437:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  80043a:	eb 55                	jmp    800491 <vprintfmt+0x1e1>
  80043c:	83 ec 08             	sub    $0x8,%esp
  80043f:	ff 75 d8             	pushl  -0x28(%ebp)
  800442:	ff 75 cc             	pushl  -0x34(%ebp)
  800445:	e8 15 03 00 00       	call   80075f <strnlen>
  80044a:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  80044d:	29 c2                	sub    %eax,%edx
  80044f:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  800452:	83 c4 10             	add    $0x10,%esp
  800455:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  800457:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  80045b:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  80045e:	85 ff                	test   %edi,%edi
  800460:	7e 11                	jle    800473 <vprintfmt+0x1c3>
					putch(padc, putdat);
  800462:	83 ec 08             	sub    $0x8,%esp
  800465:	53                   	push   %ebx
  800466:	ff 75 d4             	pushl  -0x2c(%ebp)
  800469:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  80046b:	83 ef 01             	sub    $0x1,%edi
  80046e:	83 c4 10             	add    $0x10,%esp
  800471:	eb eb                	jmp    80045e <vprintfmt+0x1ae>
  800473:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  800476:	85 d2                	test   %edx,%edx
  800478:	b8 00 00 00 00       	mov    $0x0,%eax
  80047d:	0f 49 c2             	cmovns %edx,%eax
  800480:	29 c2                	sub    %eax,%edx
  800482:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  800485:	eb a8                	jmp    80042f <vprintfmt+0x17f>
					putch(ch, putdat);
  800487:	83 ec 08             	sub    $0x8,%esp
  80048a:	53                   	push   %ebx
  80048b:	52                   	push   %edx
  80048c:	ff d6                	call   *%esi
  80048e:	83 c4 10             	add    $0x10,%esp
  800491:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800494:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  800496:	83 c7 01             	add    $0x1,%edi
  800499:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  80049d:	0f be d0             	movsbl %al,%edx
  8004a0:	85 d2                	test   %edx,%edx
  8004a2:	74 4b                	je     8004ef <vprintfmt+0x23f>
  8004a4:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  8004a8:	78 06                	js     8004b0 <vprintfmt+0x200>
  8004aa:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  8004ae:	78 1e                	js     8004ce <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  8004b0:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  8004b4:	74 d1                	je     800487 <vprintfmt+0x1d7>
  8004b6:	0f be c0             	movsbl %al,%eax
  8004b9:	83 e8 20             	sub    $0x20,%eax
  8004bc:	83 f8 5e             	cmp    $0x5e,%eax
  8004bf:	76 c6                	jbe    800487 <vprintfmt+0x1d7>
					putch('?', putdat);
  8004c1:	83 ec 08             	sub    $0x8,%esp
  8004c4:	53                   	push   %ebx
  8004c5:	6a 3f                	push   $0x3f
  8004c7:	ff d6                	call   *%esi
  8004c9:	83 c4 10             	add    $0x10,%esp
  8004cc:	eb c3                	jmp    800491 <vprintfmt+0x1e1>
  8004ce:	89 cf                	mov    %ecx,%edi
  8004d0:	eb 0e                	jmp    8004e0 <vprintfmt+0x230>
				putch(' ', putdat);
  8004d2:	83 ec 08             	sub    $0x8,%esp
  8004d5:	53                   	push   %ebx
  8004d6:	6a 20                	push   $0x20
  8004d8:	ff d6                	call   *%esi
			for (; width > 0; width--)
  8004da:	83 ef 01             	sub    $0x1,%edi
  8004dd:	83 c4 10             	add    $0x10,%esp
  8004e0:	85 ff                	test   %edi,%edi
  8004e2:	7f ee                	jg     8004d2 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  8004e4:	8b 45 c8             	mov    -0x38(%ebp),%eax
  8004e7:	89 45 14             	mov    %eax,0x14(%ebp)
  8004ea:	e9 36 01 00 00       	jmp    800625 <vprintfmt+0x375>
  8004ef:	89 cf                	mov    %ecx,%edi
  8004f1:	eb ed                	jmp    8004e0 <vprintfmt+0x230>
	if (lflag >= 2)
  8004f3:	83 f9 01             	cmp    $0x1,%ecx
  8004f6:	7f 1f                	jg     800517 <vprintfmt+0x267>
	else if (lflag)
  8004f8:	85 c9                	test   %ecx,%ecx
  8004fa:	74 67                	je     800563 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  8004fc:	8b 45 14             	mov    0x14(%ebp),%eax
  8004ff:	8b 00                	mov    (%eax),%eax
  800501:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800504:	89 c1                	mov    %eax,%ecx
  800506:	c1 f9 1f             	sar    $0x1f,%ecx
  800509:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  80050c:	8b 45 14             	mov    0x14(%ebp),%eax
  80050f:	8d 40 04             	lea    0x4(%eax),%eax
  800512:	89 45 14             	mov    %eax,0x14(%ebp)
  800515:	eb 17                	jmp    80052e <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  800517:	8b 45 14             	mov    0x14(%ebp),%eax
  80051a:	8b 50 04             	mov    0x4(%eax),%edx
  80051d:	8b 00                	mov    (%eax),%eax
  80051f:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800522:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800525:	8b 45 14             	mov    0x14(%ebp),%eax
  800528:	8d 40 08             	lea    0x8(%eax),%eax
  80052b:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  80052e:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800531:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  800534:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  800539:	85 c9                	test   %ecx,%ecx
  80053b:	0f 89 ca 00 00 00    	jns    80060b <vprintfmt+0x35b>
				putch('-', putdat);
  800541:	83 ec 08             	sub    $0x8,%esp
  800544:	53                   	push   %ebx
  800545:	6a 2d                	push   $0x2d
  800547:	ff d6                	call   *%esi
				num = -(long long) num;
  800549:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80054c:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  80054f:	f7 da                	neg    %edx
  800551:	83 d1 00             	adc    $0x0,%ecx
  800554:	f7 d9                	neg    %ecx
  800556:	83 c4 10             	add    $0x10,%esp
			base = 10;
  800559:	b8 0a 00 00 00       	mov    $0xa,%eax
  80055e:	e9 a8 00 00 00       	jmp    80060b <vprintfmt+0x35b>
		return va_arg(*ap, int);
  800563:	8b 45 14             	mov    0x14(%ebp),%eax
  800566:	8b 00                	mov    (%eax),%eax
  800568:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80056b:	99                   	cltd   
  80056c:	89 55 dc             	mov    %edx,-0x24(%ebp)
  80056f:	8b 45 14             	mov    0x14(%ebp),%eax
  800572:	8d 40 04             	lea    0x4(%eax),%eax
  800575:	89 45 14             	mov    %eax,0x14(%ebp)
  800578:	eb b4                	jmp    80052e <vprintfmt+0x27e>
	if (lflag >= 2)
  80057a:	83 f9 01             	cmp    $0x1,%ecx
  80057d:	7f 1b                	jg     80059a <vprintfmt+0x2ea>
	else if (lflag)
  80057f:	85 c9                	test   %ecx,%ecx
  800581:	74 2c                	je     8005af <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800583:	8b 45 14             	mov    0x14(%ebp),%eax
  800586:	8b 10                	mov    (%eax),%edx
  800588:	b9 00 00 00 00       	mov    $0x0,%ecx
  80058d:	8d 40 04             	lea    0x4(%eax),%eax
  800590:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800593:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  800598:	eb 71                	jmp    80060b <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  80059a:	8b 45 14             	mov    0x14(%ebp),%eax
  80059d:	8b 10                	mov    (%eax),%edx
  80059f:	8b 48 04             	mov    0x4(%eax),%ecx
  8005a2:	8d 40 08             	lea    0x8(%eax),%eax
  8005a5:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8005a8:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  8005ad:	eb 5c                	jmp    80060b <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  8005af:	8b 45 14             	mov    0x14(%ebp),%eax
  8005b2:	8b 10                	mov    (%eax),%edx
  8005b4:	b9 00 00 00 00       	mov    $0x0,%ecx
  8005b9:	8d 40 04             	lea    0x4(%eax),%eax
  8005bc:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8005bf:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  8005c4:	eb 45                	jmp    80060b <vprintfmt+0x35b>
			putch('X', putdat);
  8005c6:	83 ec 08             	sub    $0x8,%esp
  8005c9:	53                   	push   %ebx
  8005ca:	6a 58                	push   $0x58
  8005cc:	ff d6                	call   *%esi
			putch('X', putdat);
  8005ce:	83 c4 08             	add    $0x8,%esp
  8005d1:	53                   	push   %ebx
  8005d2:	6a 58                	push   $0x58
  8005d4:	ff d6                	call   *%esi
			putch('X', putdat);
  8005d6:	83 c4 08             	add    $0x8,%esp
  8005d9:	53                   	push   %ebx
  8005da:	6a 58                	push   $0x58
  8005dc:	ff d6                	call   *%esi
			break;
  8005de:	83 c4 10             	add    $0x10,%esp
  8005e1:	eb 42                	jmp    800625 <vprintfmt+0x375>
			putch('0', putdat);
  8005e3:	83 ec 08             	sub    $0x8,%esp
  8005e6:	53                   	push   %ebx
  8005e7:	6a 30                	push   $0x30
  8005e9:	ff d6                	call   *%esi
			putch('x', putdat);
  8005eb:	83 c4 08             	add    $0x8,%esp
  8005ee:	53                   	push   %ebx
  8005ef:	6a 78                	push   $0x78
  8005f1:	ff d6                	call   *%esi
			num = (unsigned long long)
  8005f3:	8b 45 14             	mov    0x14(%ebp),%eax
  8005f6:	8b 10                	mov    (%eax),%edx
  8005f8:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  8005fd:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  800600:	8d 40 04             	lea    0x4(%eax),%eax
  800603:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800606:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  80060b:	83 ec 0c             	sub    $0xc,%esp
  80060e:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  800612:	57                   	push   %edi
  800613:	ff 75 d4             	pushl  -0x2c(%ebp)
  800616:	50                   	push   %eax
  800617:	51                   	push   %ecx
  800618:	52                   	push   %edx
  800619:	89 da                	mov    %ebx,%edx
  80061b:	89 f0                	mov    %esi,%eax
  80061d:	e8 a3 fb ff ff       	call   8001c5 <printnum>
			break;
  800622:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  800625:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  800628:	83 c7 01             	add    $0x1,%edi
  80062b:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  80062f:	83 f8 25             	cmp    $0x25,%eax
  800632:	0f 84 93 fc ff ff    	je     8002cb <vprintfmt+0x1b>
			if (ch == '\0')
  800638:	85 c0                	test   %eax,%eax
  80063a:	0f 84 8b 00 00 00    	je     8006cb <vprintfmt+0x41b>
			putch(ch, putdat);
  800640:	83 ec 08             	sub    $0x8,%esp
  800643:	53                   	push   %ebx
  800644:	50                   	push   %eax
  800645:	ff d6                	call   *%esi
  800647:	83 c4 10             	add    $0x10,%esp
  80064a:	eb dc                	jmp    800628 <vprintfmt+0x378>
	if (lflag >= 2)
  80064c:	83 f9 01             	cmp    $0x1,%ecx
  80064f:	7f 1b                	jg     80066c <vprintfmt+0x3bc>
	else if (lflag)
  800651:	85 c9                	test   %ecx,%ecx
  800653:	74 2c                	je     800681 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  800655:	8b 45 14             	mov    0x14(%ebp),%eax
  800658:	8b 10                	mov    (%eax),%edx
  80065a:	b9 00 00 00 00       	mov    $0x0,%ecx
  80065f:	8d 40 04             	lea    0x4(%eax),%eax
  800662:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800665:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  80066a:	eb 9f                	jmp    80060b <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  80066c:	8b 45 14             	mov    0x14(%ebp),%eax
  80066f:	8b 10                	mov    (%eax),%edx
  800671:	8b 48 04             	mov    0x4(%eax),%ecx
  800674:	8d 40 08             	lea    0x8(%eax),%eax
  800677:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80067a:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  80067f:	eb 8a                	jmp    80060b <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800681:	8b 45 14             	mov    0x14(%ebp),%eax
  800684:	8b 10                	mov    (%eax),%edx
  800686:	b9 00 00 00 00       	mov    $0x0,%ecx
  80068b:	8d 40 04             	lea    0x4(%eax),%eax
  80068e:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800691:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  800696:	e9 70 ff ff ff       	jmp    80060b <vprintfmt+0x35b>
			putch(ch, putdat);
  80069b:	83 ec 08             	sub    $0x8,%esp
  80069e:	53                   	push   %ebx
  80069f:	6a 25                	push   $0x25
  8006a1:	ff d6                	call   *%esi
			break;
  8006a3:	83 c4 10             	add    $0x10,%esp
  8006a6:	e9 7a ff ff ff       	jmp    800625 <vprintfmt+0x375>
			putch('%', putdat);
  8006ab:	83 ec 08             	sub    $0x8,%esp
  8006ae:	53                   	push   %ebx
  8006af:	6a 25                	push   $0x25
  8006b1:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  8006b3:	83 c4 10             	add    $0x10,%esp
  8006b6:	89 f8                	mov    %edi,%eax
  8006b8:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  8006bc:	74 05                	je     8006c3 <vprintfmt+0x413>
  8006be:	83 e8 01             	sub    $0x1,%eax
  8006c1:	eb f5                	jmp    8006b8 <vprintfmt+0x408>
  8006c3:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8006c6:	e9 5a ff ff ff       	jmp    800625 <vprintfmt+0x375>
}
  8006cb:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8006ce:	5b                   	pop    %ebx
  8006cf:	5e                   	pop    %esi
  8006d0:	5f                   	pop    %edi
  8006d1:	5d                   	pop    %ebp
  8006d2:	c3                   	ret    

008006d3 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  8006d3:	f3 0f 1e fb          	endbr32 
  8006d7:	55                   	push   %ebp
  8006d8:	89 e5                	mov    %esp,%ebp
  8006da:	83 ec 18             	sub    $0x18,%esp
  8006dd:	8b 45 08             	mov    0x8(%ebp),%eax
  8006e0:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  8006e3:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8006e6:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  8006ea:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  8006ed:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  8006f4:	85 c0                	test   %eax,%eax
  8006f6:	74 26                	je     80071e <vsnprintf+0x4b>
  8006f8:	85 d2                	test   %edx,%edx
  8006fa:	7e 22                	jle    80071e <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  8006fc:	ff 75 14             	pushl  0x14(%ebp)
  8006ff:	ff 75 10             	pushl  0x10(%ebp)
  800702:	8d 45 ec             	lea    -0x14(%ebp),%eax
  800705:	50                   	push   %eax
  800706:	68 6e 02 80 00       	push   $0x80026e
  80070b:	e8 a0 fb ff ff       	call   8002b0 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  800710:	8b 45 ec             	mov    -0x14(%ebp),%eax
  800713:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  800716:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800719:	83 c4 10             	add    $0x10,%esp
}
  80071c:	c9                   	leave  
  80071d:	c3                   	ret    
		return -E_INVAL;
  80071e:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800723:	eb f7                	jmp    80071c <vsnprintf+0x49>

00800725 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  800725:	f3 0f 1e fb          	endbr32 
  800729:	55                   	push   %ebp
  80072a:	89 e5                	mov    %esp,%ebp
  80072c:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  80072f:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  800732:	50                   	push   %eax
  800733:	ff 75 10             	pushl  0x10(%ebp)
  800736:	ff 75 0c             	pushl  0xc(%ebp)
  800739:	ff 75 08             	pushl  0x8(%ebp)
  80073c:	e8 92 ff ff ff       	call   8006d3 <vsnprintf>
	va_end(ap);

	return rc;
}
  800741:	c9                   	leave  
  800742:	c3                   	ret    

00800743 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  800743:	f3 0f 1e fb          	endbr32 
  800747:	55                   	push   %ebp
  800748:	89 e5                	mov    %esp,%ebp
  80074a:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  80074d:	b8 00 00 00 00       	mov    $0x0,%eax
  800752:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  800756:	74 05                	je     80075d <strlen+0x1a>
		n++;
  800758:	83 c0 01             	add    $0x1,%eax
  80075b:	eb f5                	jmp    800752 <strlen+0xf>
	return n;
}
  80075d:	5d                   	pop    %ebp
  80075e:	c3                   	ret    

0080075f <strnlen>:

int
strnlen(const char *s, size_t size)
{
  80075f:	f3 0f 1e fb          	endbr32 
  800763:	55                   	push   %ebp
  800764:	89 e5                	mov    %esp,%ebp
  800766:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800769:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  80076c:	b8 00 00 00 00       	mov    $0x0,%eax
  800771:	39 d0                	cmp    %edx,%eax
  800773:	74 0d                	je     800782 <strnlen+0x23>
  800775:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  800779:	74 05                	je     800780 <strnlen+0x21>
		n++;
  80077b:	83 c0 01             	add    $0x1,%eax
  80077e:	eb f1                	jmp    800771 <strnlen+0x12>
  800780:	89 c2                	mov    %eax,%edx
	return n;
}
  800782:	89 d0                	mov    %edx,%eax
  800784:	5d                   	pop    %ebp
  800785:	c3                   	ret    

00800786 <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  800786:	f3 0f 1e fb          	endbr32 
  80078a:	55                   	push   %ebp
  80078b:	89 e5                	mov    %esp,%ebp
  80078d:	53                   	push   %ebx
  80078e:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800791:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800794:	b8 00 00 00 00       	mov    $0x0,%eax
  800799:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  80079d:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  8007a0:	83 c0 01             	add    $0x1,%eax
  8007a3:	84 d2                	test   %dl,%dl
  8007a5:	75 f2                	jne    800799 <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  8007a7:	89 c8                	mov    %ecx,%eax
  8007a9:	5b                   	pop    %ebx
  8007aa:	5d                   	pop    %ebp
  8007ab:	c3                   	ret    

008007ac <strcat>:

char *
strcat(char *dst, const char *src)
{
  8007ac:	f3 0f 1e fb          	endbr32 
  8007b0:	55                   	push   %ebp
  8007b1:	89 e5                	mov    %esp,%ebp
  8007b3:	53                   	push   %ebx
  8007b4:	83 ec 10             	sub    $0x10,%esp
  8007b7:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  8007ba:	53                   	push   %ebx
  8007bb:	e8 83 ff ff ff       	call   800743 <strlen>
  8007c0:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  8007c3:	ff 75 0c             	pushl  0xc(%ebp)
  8007c6:	01 d8                	add    %ebx,%eax
  8007c8:	50                   	push   %eax
  8007c9:	e8 b8 ff ff ff       	call   800786 <strcpy>
	return dst;
}
  8007ce:	89 d8                	mov    %ebx,%eax
  8007d0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8007d3:	c9                   	leave  
  8007d4:	c3                   	ret    

008007d5 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  8007d5:	f3 0f 1e fb          	endbr32 
  8007d9:	55                   	push   %ebp
  8007da:	89 e5                	mov    %esp,%ebp
  8007dc:	56                   	push   %esi
  8007dd:	53                   	push   %ebx
  8007de:	8b 75 08             	mov    0x8(%ebp),%esi
  8007e1:	8b 55 0c             	mov    0xc(%ebp),%edx
  8007e4:	89 f3                	mov    %esi,%ebx
  8007e6:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  8007e9:	89 f0                	mov    %esi,%eax
  8007eb:	39 d8                	cmp    %ebx,%eax
  8007ed:	74 11                	je     800800 <strncpy+0x2b>
		*dst++ = *src;
  8007ef:	83 c0 01             	add    $0x1,%eax
  8007f2:	0f b6 0a             	movzbl (%edx),%ecx
  8007f5:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  8007f8:	80 f9 01             	cmp    $0x1,%cl
  8007fb:	83 da ff             	sbb    $0xffffffff,%edx
  8007fe:	eb eb                	jmp    8007eb <strncpy+0x16>
	}
	return ret;
}
  800800:	89 f0                	mov    %esi,%eax
  800802:	5b                   	pop    %ebx
  800803:	5e                   	pop    %esi
  800804:	5d                   	pop    %ebp
  800805:	c3                   	ret    

00800806 <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  800806:	f3 0f 1e fb          	endbr32 
  80080a:	55                   	push   %ebp
  80080b:	89 e5                	mov    %esp,%ebp
  80080d:	56                   	push   %esi
  80080e:	53                   	push   %ebx
  80080f:	8b 75 08             	mov    0x8(%ebp),%esi
  800812:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800815:	8b 55 10             	mov    0x10(%ebp),%edx
  800818:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  80081a:	85 d2                	test   %edx,%edx
  80081c:	74 21                	je     80083f <strlcpy+0x39>
  80081e:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  800822:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  800824:	39 c2                	cmp    %eax,%edx
  800826:	74 14                	je     80083c <strlcpy+0x36>
  800828:	0f b6 19             	movzbl (%ecx),%ebx
  80082b:	84 db                	test   %bl,%bl
  80082d:	74 0b                	je     80083a <strlcpy+0x34>
			*dst++ = *src++;
  80082f:	83 c1 01             	add    $0x1,%ecx
  800832:	83 c2 01             	add    $0x1,%edx
  800835:	88 5a ff             	mov    %bl,-0x1(%edx)
  800838:	eb ea                	jmp    800824 <strlcpy+0x1e>
  80083a:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  80083c:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  80083f:	29 f0                	sub    %esi,%eax
}
  800841:	5b                   	pop    %ebx
  800842:	5e                   	pop    %esi
  800843:	5d                   	pop    %ebp
  800844:	c3                   	ret    

00800845 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  800845:	f3 0f 1e fb          	endbr32 
  800849:	55                   	push   %ebp
  80084a:	89 e5                	mov    %esp,%ebp
  80084c:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80084f:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800852:	0f b6 01             	movzbl (%ecx),%eax
  800855:	84 c0                	test   %al,%al
  800857:	74 0c                	je     800865 <strcmp+0x20>
  800859:	3a 02                	cmp    (%edx),%al
  80085b:	75 08                	jne    800865 <strcmp+0x20>
		p++, q++;
  80085d:	83 c1 01             	add    $0x1,%ecx
  800860:	83 c2 01             	add    $0x1,%edx
  800863:	eb ed                	jmp    800852 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  800865:	0f b6 c0             	movzbl %al,%eax
  800868:	0f b6 12             	movzbl (%edx),%edx
  80086b:	29 d0                	sub    %edx,%eax
}
  80086d:	5d                   	pop    %ebp
  80086e:	c3                   	ret    

0080086f <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  80086f:	f3 0f 1e fb          	endbr32 
  800873:	55                   	push   %ebp
  800874:	89 e5                	mov    %esp,%ebp
  800876:	53                   	push   %ebx
  800877:	8b 45 08             	mov    0x8(%ebp),%eax
  80087a:	8b 55 0c             	mov    0xc(%ebp),%edx
  80087d:	89 c3                	mov    %eax,%ebx
  80087f:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800882:	eb 06                	jmp    80088a <strncmp+0x1b>
		n--, p++, q++;
  800884:	83 c0 01             	add    $0x1,%eax
  800887:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  80088a:	39 d8                	cmp    %ebx,%eax
  80088c:	74 16                	je     8008a4 <strncmp+0x35>
  80088e:	0f b6 08             	movzbl (%eax),%ecx
  800891:	84 c9                	test   %cl,%cl
  800893:	74 04                	je     800899 <strncmp+0x2a>
  800895:	3a 0a                	cmp    (%edx),%cl
  800897:	74 eb                	je     800884 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  800899:	0f b6 00             	movzbl (%eax),%eax
  80089c:	0f b6 12             	movzbl (%edx),%edx
  80089f:	29 d0                	sub    %edx,%eax
}
  8008a1:	5b                   	pop    %ebx
  8008a2:	5d                   	pop    %ebp
  8008a3:	c3                   	ret    
		return 0;
  8008a4:	b8 00 00 00 00       	mov    $0x0,%eax
  8008a9:	eb f6                	jmp    8008a1 <strncmp+0x32>

008008ab <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  8008ab:	f3 0f 1e fb          	endbr32 
  8008af:	55                   	push   %ebp
  8008b0:	89 e5                	mov    %esp,%ebp
  8008b2:	8b 45 08             	mov    0x8(%ebp),%eax
  8008b5:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8008b9:	0f b6 10             	movzbl (%eax),%edx
  8008bc:	84 d2                	test   %dl,%dl
  8008be:	74 09                	je     8008c9 <strchr+0x1e>
		if (*s == c)
  8008c0:	38 ca                	cmp    %cl,%dl
  8008c2:	74 0a                	je     8008ce <strchr+0x23>
	for (; *s; s++)
  8008c4:	83 c0 01             	add    $0x1,%eax
  8008c7:	eb f0                	jmp    8008b9 <strchr+0xe>
			return (char *) s;
	return 0;
  8008c9:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8008ce:	5d                   	pop    %ebp
  8008cf:	c3                   	ret    

008008d0 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  8008d0:	f3 0f 1e fb          	endbr32 
  8008d4:	55                   	push   %ebp
  8008d5:	89 e5                	mov    %esp,%ebp
  8008d7:	8b 45 08             	mov    0x8(%ebp),%eax
  8008da:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8008de:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  8008e1:	38 ca                	cmp    %cl,%dl
  8008e3:	74 09                	je     8008ee <strfind+0x1e>
  8008e5:	84 d2                	test   %dl,%dl
  8008e7:	74 05                	je     8008ee <strfind+0x1e>
	for (; *s; s++)
  8008e9:	83 c0 01             	add    $0x1,%eax
  8008ec:	eb f0                	jmp    8008de <strfind+0xe>
			break;
	return (char *) s;
}
  8008ee:	5d                   	pop    %ebp
  8008ef:	c3                   	ret    

008008f0 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  8008f0:	f3 0f 1e fb          	endbr32 
  8008f4:	55                   	push   %ebp
  8008f5:	89 e5                	mov    %esp,%ebp
  8008f7:	57                   	push   %edi
  8008f8:	56                   	push   %esi
  8008f9:	53                   	push   %ebx
  8008fa:	8b 7d 08             	mov    0x8(%ebp),%edi
  8008fd:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  800900:	85 c9                	test   %ecx,%ecx
  800902:	74 31                	je     800935 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  800904:	89 f8                	mov    %edi,%eax
  800906:	09 c8                	or     %ecx,%eax
  800908:	a8 03                	test   $0x3,%al
  80090a:	75 23                	jne    80092f <memset+0x3f>
		c &= 0xFF;
  80090c:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  800910:	89 d3                	mov    %edx,%ebx
  800912:	c1 e3 08             	shl    $0x8,%ebx
  800915:	89 d0                	mov    %edx,%eax
  800917:	c1 e0 18             	shl    $0x18,%eax
  80091a:	89 d6                	mov    %edx,%esi
  80091c:	c1 e6 10             	shl    $0x10,%esi
  80091f:	09 f0                	or     %esi,%eax
  800921:	09 c2                	or     %eax,%edx
  800923:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  800925:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  800928:	89 d0                	mov    %edx,%eax
  80092a:	fc                   	cld    
  80092b:	f3 ab                	rep stos %eax,%es:(%edi)
  80092d:	eb 06                	jmp    800935 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  80092f:	8b 45 0c             	mov    0xc(%ebp),%eax
  800932:	fc                   	cld    
  800933:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  800935:	89 f8                	mov    %edi,%eax
  800937:	5b                   	pop    %ebx
  800938:	5e                   	pop    %esi
  800939:	5f                   	pop    %edi
  80093a:	5d                   	pop    %ebp
  80093b:	c3                   	ret    

0080093c <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  80093c:	f3 0f 1e fb          	endbr32 
  800940:	55                   	push   %ebp
  800941:	89 e5                	mov    %esp,%ebp
  800943:	57                   	push   %edi
  800944:	56                   	push   %esi
  800945:	8b 45 08             	mov    0x8(%ebp),%eax
  800948:	8b 75 0c             	mov    0xc(%ebp),%esi
  80094b:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  80094e:	39 c6                	cmp    %eax,%esi
  800950:	73 32                	jae    800984 <memmove+0x48>
  800952:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  800955:	39 c2                	cmp    %eax,%edx
  800957:	76 2b                	jbe    800984 <memmove+0x48>
		s += n;
		d += n;
  800959:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  80095c:	89 fe                	mov    %edi,%esi
  80095e:	09 ce                	or     %ecx,%esi
  800960:	09 d6                	or     %edx,%esi
  800962:	f7 c6 03 00 00 00    	test   $0x3,%esi
  800968:	75 0e                	jne    800978 <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  80096a:	83 ef 04             	sub    $0x4,%edi
  80096d:	8d 72 fc             	lea    -0x4(%edx),%esi
  800970:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800973:	fd                   	std    
  800974:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800976:	eb 09                	jmp    800981 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  800978:	83 ef 01             	sub    $0x1,%edi
  80097b:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  80097e:	fd                   	std    
  80097f:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800981:	fc                   	cld    
  800982:	eb 1a                	jmp    80099e <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800984:	89 c2                	mov    %eax,%edx
  800986:	09 ca                	or     %ecx,%edx
  800988:	09 f2                	or     %esi,%edx
  80098a:	f6 c2 03             	test   $0x3,%dl
  80098d:	75 0a                	jne    800999 <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  80098f:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800992:	89 c7                	mov    %eax,%edi
  800994:	fc                   	cld    
  800995:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800997:	eb 05                	jmp    80099e <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  800999:	89 c7                	mov    %eax,%edi
  80099b:	fc                   	cld    
  80099c:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  80099e:	5e                   	pop    %esi
  80099f:	5f                   	pop    %edi
  8009a0:	5d                   	pop    %ebp
  8009a1:	c3                   	ret    

008009a2 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  8009a2:	f3 0f 1e fb          	endbr32 
  8009a6:	55                   	push   %ebp
  8009a7:	89 e5                	mov    %esp,%ebp
  8009a9:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  8009ac:	ff 75 10             	pushl  0x10(%ebp)
  8009af:	ff 75 0c             	pushl  0xc(%ebp)
  8009b2:	ff 75 08             	pushl  0x8(%ebp)
  8009b5:	e8 82 ff ff ff       	call   80093c <memmove>
}
  8009ba:	c9                   	leave  
  8009bb:	c3                   	ret    

008009bc <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  8009bc:	f3 0f 1e fb          	endbr32 
  8009c0:	55                   	push   %ebp
  8009c1:	89 e5                	mov    %esp,%ebp
  8009c3:	56                   	push   %esi
  8009c4:	53                   	push   %ebx
  8009c5:	8b 45 08             	mov    0x8(%ebp),%eax
  8009c8:	8b 55 0c             	mov    0xc(%ebp),%edx
  8009cb:	89 c6                	mov    %eax,%esi
  8009cd:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  8009d0:	39 f0                	cmp    %esi,%eax
  8009d2:	74 1c                	je     8009f0 <memcmp+0x34>
		if (*s1 != *s2)
  8009d4:	0f b6 08             	movzbl (%eax),%ecx
  8009d7:	0f b6 1a             	movzbl (%edx),%ebx
  8009da:	38 d9                	cmp    %bl,%cl
  8009dc:	75 08                	jne    8009e6 <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  8009de:	83 c0 01             	add    $0x1,%eax
  8009e1:	83 c2 01             	add    $0x1,%edx
  8009e4:	eb ea                	jmp    8009d0 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  8009e6:	0f b6 c1             	movzbl %cl,%eax
  8009e9:	0f b6 db             	movzbl %bl,%ebx
  8009ec:	29 d8                	sub    %ebx,%eax
  8009ee:	eb 05                	jmp    8009f5 <memcmp+0x39>
	}

	return 0;
  8009f0:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8009f5:	5b                   	pop    %ebx
  8009f6:	5e                   	pop    %esi
  8009f7:	5d                   	pop    %ebp
  8009f8:	c3                   	ret    

008009f9 <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  8009f9:	f3 0f 1e fb          	endbr32 
  8009fd:	55                   	push   %ebp
  8009fe:	89 e5                	mov    %esp,%ebp
  800a00:	8b 45 08             	mov    0x8(%ebp),%eax
  800a03:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  800a06:	89 c2                	mov    %eax,%edx
  800a08:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800a0b:	39 d0                	cmp    %edx,%eax
  800a0d:	73 09                	jae    800a18 <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800a0f:	38 08                	cmp    %cl,(%eax)
  800a11:	74 05                	je     800a18 <memfind+0x1f>
	for (; s < ends; s++)
  800a13:	83 c0 01             	add    $0x1,%eax
  800a16:	eb f3                	jmp    800a0b <memfind+0x12>
			break;
	return (void *) s;
}
  800a18:	5d                   	pop    %ebp
  800a19:	c3                   	ret    

00800a1a <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800a1a:	f3 0f 1e fb          	endbr32 
  800a1e:	55                   	push   %ebp
  800a1f:	89 e5                	mov    %esp,%ebp
  800a21:	57                   	push   %edi
  800a22:	56                   	push   %esi
  800a23:	53                   	push   %ebx
  800a24:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800a27:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800a2a:	eb 03                	jmp    800a2f <strtol+0x15>
		s++;
  800a2c:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800a2f:	0f b6 01             	movzbl (%ecx),%eax
  800a32:	3c 20                	cmp    $0x20,%al
  800a34:	74 f6                	je     800a2c <strtol+0x12>
  800a36:	3c 09                	cmp    $0x9,%al
  800a38:	74 f2                	je     800a2c <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800a3a:	3c 2b                	cmp    $0x2b,%al
  800a3c:	74 2a                	je     800a68 <strtol+0x4e>
	int neg = 0;
  800a3e:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800a43:	3c 2d                	cmp    $0x2d,%al
  800a45:	74 2b                	je     800a72 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a47:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800a4d:	75 0f                	jne    800a5e <strtol+0x44>
  800a4f:	80 39 30             	cmpb   $0x30,(%ecx)
  800a52:	74 28                	je     800a7c <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800a54:	85 db                	test   %ebx,%ebx
  800a56:	b8 0a 00 00 00       	mov    $0xa,%eax
  800a5b:	0f 44 d8             	cmove  %eax,%ebx
  800a5e:	b8 00 00 00 00       	mov    $0x0,%eax
  800a63:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800a66:	eb 46                	jmp    800aae <strtol+0x94>
		s++;
  800a68:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800a6b:	bf 00 00 00 00       	mov    $0x0,%edi
  800a70:	eb d5                	jmp    800a47 <strtol+0x2d>
		s++, neg = 1;
  800a72:	83 c1 01             	add    $0x1,%ecx
  800a75:	bf 01 00 00 00       	mov    $0x1,%edi
  800a7a:	eb cb                	jmp    800a47 <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a7c:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800a80:	74 0e                	je     800a90 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800a82:	85 db                	test   %ebx,%ebx
  800a84:	75 d8                	jne    800a5e <strtol+0x44>
		s++, base = 8;
  800a86:	83 c1 01             	add    $0x1,%ecx
  800a89:	bb 08 00 00 00       	mov    $0x8,%ebx
  800a8e:	eb ce                	jmp    800a5e <strtol+0x44>
		s += 2, base = 16;
  800a90:	83 c1 02             	add    $0x2,%ecx
  800a93:	bb 10 00 00 00       	mov    $0x10,%ebx
  800a98:	eb c4                	jmp    800a5e <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800a9a:	0f be d2             	movsbl %dl,%edx
  800a9d:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800aa0:	3b 55 10             	cmp    0x10(%ebp),%edx
  800aa3:	7d 3a                	jge    800adf <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800aa5:	83 c1 01             	add    $0x1,%ecx
  800aa8:	0f af 45 10          	imul   0x10(%ebp),%eax
  800aac:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800aae:	0f b6 11             	movzbl (%ecx),%edx
  800ab1:	8d 72 d0             	lea    -0x30(%edx),%esi
  800ab4:	89 f3                	mov    %esi,%ebx
  800ab6:	80 fb 09             	cmp    $0x9,%bl
  800ab9:	76 df                	jbe    800a9a <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800abb:	8d 72 9f             	lea    -0x61(%edx),%esi
  800abe:	89 f3                	mov    %esi,%ebx
  800ac0:	80 fb 19             	cmp    $0x19,%bl
  800ac3:	77 08                	ja     800acd <strtol+0xb3>
			dig = *s - 'a' + 10;
  800ac5:	0f be d2             	movsbl %dl,%edx
  800ac8:	83 ea 57             	sub    $0x57,%edx
  800acb:	eb d3                	jmp    800aa0 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800acd:	8d 72 bf             	lea    -0x41(%edx),%esi
  800ad0:	89 f3                	mov    %esi,%ebx
  800ad2:	80 fb 19             	cmp    $0x19,%bl
  800ad5:	77 08                	ja     800adf <strtol+0xc5>
			dig = *s - 'A' + 10;
  800ad7:	0f be d2             	movsbl %dl,%edx
  800ada:	83 ea 37             	sub    $0x37,%edx
  800add:	eb c1                	jmp    800aa0 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800adf:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800ae3:	74 05                	je     800aea <strtol+0xd0>
		*endptr = (char *) s;
  800ae5:	8b 75 0c             	mov    0xc(%ebp),%esi
  800ae8:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800aea:	89 c2                	mov    %eax,%edx
  800aec:	f7 da                	neg    %edx
  800aee:	85 ff                	test   %edi,%edi
  800af0:	0f 45 c2             	cmovne %edx,%eax
}
  800af3:	5b                   	pop    %ebx
  800af4:	5e                   	pop    %esi
  800af5:	5f                   	pop    %edi
  800af6:	5d                   	pop    %ebp
  800af7:	c3                   	ret    

00800af8 <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800af8:	f3 0f 1e fb          	endbr32 
  800afc:	55                   	push   %ebp
  800afd:	89 e5                	mov    %esp,%ebp
  800aff:	57                   	push   %edi
  800b00:	56                   	push   %esi
  800b01:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b02:	b8 00 00 00 00       	mov    $0x0,%eax
  800b07:	8b 55 08             	mov    0x8(%ebp),%edx
  800b0a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800b0d:	89 c3                	mov    %eax,%ebx
  800b0f:	89 c7                	mov    %eax,%edi
  800b11:	89 c6                	mov    %eax,%esi
  800b13:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800b15:	5b                   	pop    %ebx
  800b16:	5e                   	pop    %esi
  800b17:	5f                   	pop    %edi
  800b18:	5d                   	pop    %ebp
  800b19:	c3                   	ret    

00800b1a <sys_cgetc>:

int
sys_cgetc(void)
{
  800b1a:	f3 0f 1e fb          	endbr32 
  800b1e:	55                   	push   %ebp
  800b1f:	89 e5                	mov    %esp,%ebp
  800b21:	57                   	push   %edi
  800b22:	56                   	push   %esi
  800b23:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b24:	ba 00 00 00 00       	mov    $0x0,%edx
  800b29:	b8 01 00 00 00       	mov    $0x1,%eax
  800b2e:	89 d1                	mov    %edx,%ecx
  800b30:	89 d3                	mov    %edx,%ebx
  800b32:	89 d7                	mov    %edx,%edi
  800b34:	89 d6                	mov    %edx,%esi
  800b36:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800b38:	5b                   	pop    %ebx
  800b39:	5e                   	pop    %esi
  800b3a:	5f                   	pop    %edi
  800b3b:	5d                   	pop    %ebp
  800b3c:	c3                   	ret    

00800b3d <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800b3d:	f3 0f 1e fb          	endbr32 
  800b41:	55                   	push   %ebp
  800b42:	89 e5                	mov    %esp,%ebp
  800b44:	57                   	push   %edi
  800b45:	56                   	push   %esi
  800b46:	53                   	push   %ebx
  800b47:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800b4a:	b9 00 00 00 00       	mov    $0x0,%ecx
  800b4f:	8b 55 08             	mov    0x8(%ebp),%edx
  800b52:	b8 03 00 00 00       	mov    $0x3,%eax
  800b57:	89 cb                	mov    %ecx,%ebx
  800b59:	89 cf                	mov    %ecx,%edi
  800b5b:	89 ce                	mov    %ecx,%esi
  800b5d:	cd 30                	int    $0x30
	if(check && ret > 0)
  800b5f:	85 c0                	test   %eax,%eax
  800b61:	7f 08                	jg     800b6b <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800b63:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800b66:	5b                   	pop    %ebx
  800b67:	5e                   	pop    %esi
  800b68:	5f                   	pop    %edi
  800b69:	5d                   	pop    %ebp
  800b6a:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800b6b:	83 ec 0c             	sub    $0xc,%esp
  800b6e:	50                   	push   %eax
  800b6f:	6a 03                	push   $0x3
  800b71:	68 9f 22 80 00       	push   $0x80229f
  800b76:	6a 23                	push   $0x23
  800b78:	68 bc 22 80 00       	push   $0x8022bc
  800b7d:	e8 9c 0f 00 00       	call   801b1e <_panic>

00800b82 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800b82:	f3 0f 1e fb          	endbr32 
  800b86:	55                   	push   %ebp
  800b87:	89 e5                	mov    %esp,%ebp
  800b89:	57                   	push   %edi
  800b8a:	56                   	push   %esi
  800b8b:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b8c:	ba 00 00 00 00       	mov    $0x0,%edx
  800b91:	b8 02 00 00 00       	mov    $0x2,%eax
  800b96:	89 d1                	mov    %edx,%ecx
  800b98:	89 d3                	mov    %edx,%ebx
  800b9a:	89 d7                	mov    %edx,%edi
  800b9c:	89 d6                	mov    %edx,%esi
  800b9e:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800ba0:	5b                   	pop    %ebx
  800ba1:	5e                   	pop    %esi
  800ba2:	5f                   	pop    %edi
  800ba3:	5d                   	pop    %ebp
  800ba4:	c3                   	ret    

00800ba5 <sys_yield>:

void
sys_yield(void)
{
  800ba5:	f3 0f 1e fb          	endbr32 
  800ba9:	55                   	push   %ebp
  800baa:	89 e5                	mov    %esp,%ebp
  800bac:	57                   	push   %edi
  800bad:	56                   	push   %esi
  800bae:	53                   	push   %ebx
	asm volatile("int %1\n"
  800baf:	ba 00 00 00 00       	mov    $0x0,%edx
  800bb4:	b8 0b 00 00 00       	mov    $0xb,%eax
  800bb9:	89 d1                	mov    %edx,%ecx
  800bbb:	89 d3                	mov    %edx,%ebx
  800bbd:	89 d7                	mov    %edx,%edi
  800bbf:	89 d6                	mov    %edx,%esi
  800bc1:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800bc3:	5b                   	pop    %ebx
  800bc4:	5e                   	pop    %esi
  800bc5:	5f                   	pop    %edi
  800bc6:	5d                   	pop    %ebp
  800bc7:	c3                   	ret    

00800bc8 <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800bc8:	f3 0f 1e fb          	endbr32 
  800bcc:	55                   	push   %ebp
  800bcd:	89 e5                	mov    %esp,%ebp
  800bcf:	57                   	push   %edi
  800bd0:	56                   	push   %esi
  800bd1:	53                   	push   %ebx
  800bd2:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800bd5:	be 00 00 00 00       	mov    $0x0,%esi
  800bda:	8b 55 08             	mov    0x8(%ebp),%edx
  800bdd:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800be0:	b8 04 00 00 00       	mov    $0x4,%eax
  800be5:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800be8:	89 f7                	mov    %esi,%edi
  800bea:	cd 30                	int    $0x30
	if(check && ret > 0)
  800bec:	85 c0                	test   %eax,%eax
  800bee:	7f 08                	jg     800bf8 <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800bf0:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bf3:	5b                   	pop    %ebx
  800bf4:	5e                   	pop    %esi
  800bf5:	5f                   	pop    %edi
  800bf6:	5d                   	pop    %ebp
  800bf7:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800bf8:	83 ec 0c             	sub    $0xc,%esp
  800bfb:	50                   	push   %eax
  800bfc:	6a 04                	push   $0x4
  800bfe:	68 9f 22 80 00       	push   $0x80229f
  800c03:	6a 23                	push   $0x23
  800c05:	68 bc 22 80 00       	push   $0x8022bc
  800c0a:	e8 0f 0f 00 00       	call   801b1e <_panic>

00800c0f <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800c0f:	f3 0f 1e fb          	endbr32 
  800c13:	55                   	push   %ebp
  800c14:	89 e5                	mov    %esp,%ebp
  800c16:	57                   	push   %edi
  800c17:	56                   	push   %esi
  800c18:	53                   	push   %ebx
  800c19:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c1c:	8b 55 08             	mov    0x8(%ebp),%edx
  800c1f:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c22:	b8 05 00 00 00       	mov    $0x5,%eax
  800c27:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800c2a:	8b 7d 14             	mov    0x14(%ebp),%edi
  800c2d:	8b 75 18             	mov    0x18(%ebp),%esi
  800c30:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c32:	85 c0                	test   %eax,%eax
  800c34:	7f 08                	jg     800c3e <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800c36:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c39:	5b                   	pop    %ebx
  800c3a:	5e                   	pop    %esi
  800c3b:	5f                   	pop    %edi
  800c3c:	5d                   	pop    %ebp
  800c3d:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c3e:	83 ec 0c             	sub    $0xc,%esp
  800c41:	50                   	push   %eax
  800c42:	6a 05                	push   $0x5
  800c44:	68 9f 22 80 00       	push   $0x80229f
  800c49:	6a 23                	push   $0x23
  800c4b:	68 bc 22 80 00       	push   $0x8022bc
  800c50:	e8 c9 0e 00 00       	call   801b1e <_panic>

00800c55 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800c55:	f3 0f 1e fb          	endbr32 
  800c59:	55                   	push   %ebp
  800c5a:	89 e5                	mov    %esp,%ebp
  800c5c:	57                   	push   %edi
  800c5d:	56                   	push   %esi
  800c5e:	53                   	push   %ebx
  800c5f:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c62:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c67:	8b 55 08             	mov    0x8(%ebp),%edx
  800c6a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c6d:	b8 06 00 00 00       	mov    $0x6,%eax
  800c72:	89 df                	mov    %ebx,%edi
  800c74:	89 de                	mov    %ebx,%esi
  800c76:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c78:	85 c0                	test   %eax,%eax
  800c7a:	7f 08                	jg     800c84 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800c7c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c7f:	5b                   	pop    %ebx
  800c80:	5e                   	pop    %esi
  800c81:	5f                   	pop    %edi
  800c82:	5d                   	pop    %ebp
  800c83:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c84:	83 ec 0c             	sub    $0xc,%esp
  800c87:	50                   	push   %eax
  800c88:	6a 06                	push   $0x6
  800c8a:	68 9f 22 80 00       	push   $0x80229f
  800c8f:	6a 23                	push   $0x23
  800c91:	68 bc 22 80 00       	push   $0x8022bc
  800c96:	e8 83 0e 00 00       	call   801b1e <_panic>

00800c9b <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800c9b:	f3 0f 1e fb          	endbr32 
  800c9f:	55                   	push   %ebp
  800ca0:	89 e5                	mov    %esp,%ebp
  800ca2:	57                   	push   %edi
  800ca3:	56                   	push   %esi
  800ca4:	53                   	push   %ebx
  800ca5:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800ca8:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cad:	8b 55 08             	mov    0x8(%ebp),%edx
  800cb0:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cb3:	b8 08 00 00 00       	mov    $0x8,%eax
  800cb8:	89 df                	mov    %ebx,%edi
  800cba:	89 de                	mov    %ebx,%esi
  800cbc:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cbe:	85 c0                	test   %eax,%eax
  800cc0:	7f 08                	jg     800cca <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800cc2:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cc5:	5b                   	pop    %ebx
  800cc6:	5e                   	pop    %esi
  800cc7:	5f                   	pop    %edi
  800cc8:	5d                   	pop    %ebp
  800cc9:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cca:	83 ec 0c             	sub    $0xc,%esp
  800ccd:	50                   	push   %eax
  800cce:	6a 08                	push   $0x8
  800cd0:	68 9f 22 80 00       	push   $0x80229f
  800cd5:	6a 23                	push   $0x23
  800cd7:	68 bc 22 80 00       	push   $0x8022bc
  800cdc:	e8 3d 0e 00 00       	call   801b1e <_panic>

00800ce1 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800ce1:	f3 0f 1e fb          	endbr32 
  800ce5:	55                   	push   %ebp
  800ce6:	89 e5                	mov    %esp,%ebp
  800ce8:	57                   	push   %edi
  800ce9:	56                   	push   %esi
  800cea:	53                   	push   %ebx
  800ceb:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cee:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cf3:	8b 55 08             	mov    0x8(%ebp),%edx
  800cf6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cf9:	b8 09 00 00 00       	mov    $0x9,%eax
  800cfe:	89 df                	mov    %ebx,%edi
  800d00:	89 de                	mov    %ebx,%esi
  800d02:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d04:	85 c0                	test   %eax,%eax
  800d06:	7f 08                	jg     800d10 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800d08:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d0b:	5b                   	pop    %ebx
  800d0c:	5e                   	pop    %esi
  800d0d:	5f                   	pop    %edi
  800d0e:	5d                   	pop    %ebp
  800d0f:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d10:	83 ec 0c             	sub    $0xc,%esp
  800d13:	50                   	push   %eax
  800d14:	6a 09                	push   $0x9
  800d16:	68 9f 22 80 00       	push   $0x80229f
  800d1b:	6a 23                	push   $0x23
  800d1d:	68 bc 22 80 00       	push   $0x8022bc
  800d22:	e8 f7 0d 00 00       	call   801b1e <_panic>

00800d27 <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800d27:	f3 0f 1e fb          	endbr32 
  800d2b:	55                   	push   %ebp
  800d2c:	89 e5                	mov    %esp,%ebp
  800d2e:	57                   	push   %edi
  800d2f:	56                   	push   %esi
  800d30:	53                   	push   %ebx
  800d31:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d34:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d39:	8b 55 08             	mov    0x8(%ebp),%edx
  800d3c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d3f:	b8 0a 00 00 00       	mov    $0xa,%eax
  800d44:	89 df                	mov    %ebx,%edi
  800d46:	89 de                	mov    %ebx,%esi
  800d48:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d4a:	85 c0                	test   %eax,%eax
  800d4c:	7f 08                	jg     800d56 <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800d4e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d51:	5b                   	pop    %ebx
  800d52:	5e                   	pop    %esi
  800d53:	5f                   	pop    %edi
  800d54:	5d                   	pop    %ebp
  800d55:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d56:	83 ec 0c             	sub    $0xc,%esp
  800d59:	50                   	push   %eax
  800d5a:	6a 0a                	push   $0xa
  800d5c:	68 9f 22 80 00       	push   $0x80229f
  800d61:	6a 23                	push   $0x23
  800d63:	68 bc 22 80 00       	push   $0x8022bc
  800d68:	e8 b1 0d 00 00       	call   801b1e <_panic>

00800d6d <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800d6d:	f3 0f 1e fb          	endbr32 
  800d71:	55                   	push   %ebp
  800d72:	89 e5                	mov    %esp,%ebp
  800d74:	57                   	push   %edi
  800d75:	56                   	push   %esi
  800d76:	53                   	push   %ebx
	asm volatile("int %1\n"
  800d77:	8b 55 08             	mov    0x8(%ebp),%edx
  800d7a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d7d:	b8 0c 00 00 00       	mov    $0xc,%eax
  800d82:	be 00 00 00 00       	mov    $0x0,%esi
  800d87:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800d8a:	8b 7d 14             	mov    0x14(%ebp),%edi
  800d8d:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800d8f:	5b                   	pop    %ebx
  800d90:	5e                   	pop    %esi
  800d91:	5f                   	pop    %edi
  800d92:	5d                   	pop    %ebp
  800d93:	c3                   	ret    

00800d94 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800d94:	f3 0f 1e fb          	endbr32 
  800d98:	55                   	push   %ebp
  800d99:	89 e5                	mov    %esp,%ebp
  800d9b:	57                   	push   %edi
  800d9c:	56                   	push   %esi
  800d9d:	53                   	push   %ebx
  800d9e:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800da1:	b9 00 00 00 00       	mov    $0x0,%ecx
  800da6:	8b 55 08             	mov    0x8(%ebp),%edx
  800da9:	b8 0d 00 00 00       	mov    $0xd,%eax
  800dae:	89 cb                	mov    %ecx,%ebx
  800db0:	89 cf                	mov    %ecx,%edi
  800db2:	89 ce                	mov    %ecx,%esi
  800db4:	cd 30                	int    $0x30
	if(check && ret > 0)
  800db6:	85 c0                	test   %eax,%eax
  800db8:	7f 08                	jg     800dc2 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800dba:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800dbd:	5b                   	pop    %ebx
  800dbe:	5e                   	pop    %esi
  800dbf:	5f                   	pop    %edi
  800dc0:	5d                   	pop    %ebp
  800dc1:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800dc2:	83 ec 0c             	sub    $0xc,%esp
  800dc5:	50                   	push   %eax
  800dc6:	6a 0d                	push   $0xd
  800dc8:	68 9f 22 80 00       	push   $0x80229f
  800dcd:	6a 23                	push   $0x23
  800dcf:	68 bc 22 80 00       	push   $0x8022bc
  800dd4:	e8 45 0d 00 00       	call   801b1e <_panic>

00800dd9 <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800dd9:	f3 0f 1e fb          	endbr32 
  800ddd:	55                   	push   %ebp
  800dde:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800de0:	8b 45 08             	mov    0x8(%ebp),%eax
  800de3:	05 00 00 00 30       	add    $0x30000000,%eax
  800de8:	c1 e8 0c             	shr    $0xc,%eax
}
  800deb:	5d                   	pop    %ebp
  800dec:	c3                   	ret    

00800ded <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800ded:	f3 0f 1e fb          	endbr32 
  800df1:	55                   	push   %ebp
  800df2:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800df4:	8b 45 08             	mov    0x8(%ebp),%eax
  800df7:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800dfc:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800e01:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800e06:	5d                   	pop    %ebp
  800e07:	c3                   	ret    

00800e08 <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800e08:	f3 0f 1e fb          	endbr32 
  800e0c:	55                   	push   %ebp
  800e0d:	89 e5                	mov    %esp,%ebp
  800e0f:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800e14:	89 c2                	mov    %eax,%edx
  800e16:	c1 ea 16             	shr    $0x16,%edx
  800e19:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800e20:	f6 c2 01             	test   $0x1,%dl
  800e23:	74 2d                	je     800e52 <fd_alloc+0x4a>
  800e25:	89 c2                	mov    %eax,%edx
  800e27:	c1 ea 0c             	shr    $0xc,%edx
  800e2a:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800e31:	f6 c2 01             	test   $0x1,%dl
  800e34:	74 1c                	je     800e52 <fd_alloc+0x4a>
  800e36:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800e3b:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800e40:	75 d2                	jne    800e14 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800e42:	8b 45 08             	mov    0x8(%ebp),%eax
  800e45:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800e4b:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800e50:	eb 0a                	jmp    800e5c <fd_alloc+0x54>
			*fd_store = fd;
  800e52:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e55:	89 01                	mov    %eax,(%ecx)
			return 0;
  800e57:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e5c:	5d                   	pop    %ebp
  800e5d:	c3                   	ret    

00800e5e <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800e5e:	f3 0f 1e fb          	endbr32 
  800e62:	55                   	push   %ebp
  800e63:	89 e5                	mov    %esp,%ebp
  800e65:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800e68:	83 f8 1f             	cmp    $0x1f,%eax
  800e6b:	77 30                	ja     800e9d <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800e6d:	c1 e0 0c             	shl    $0xc,%eax
  800e70:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800e75:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800e7b:	f6 c2 01             	test   $0x1,%dl
  800e7e:	74 24                	je     800ea4 <fd_lookup+0x46>
  800e80:	89 c2                	mov    %eax,%edx
  800e82:	c1 ea 0c             	shr    $0xc,%edx
  800e85:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800e8c:	f6 c2 01             	test   $0x1,%dl
  800e8f:	74 1a                	je     800eab <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800e91:	8b 55 0c             	mov    0xc(%ebp),%edx
  800e94:	89 02                	mov    %eax,(%edx)
	return 0;
  800e96:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e9b:	5d                   	pop    %ebp
  800e9c:	c3                   	ret    
		return -E_INVAL;
  800e9d:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800ea2:	eb f7                	jmp    800e9b <fd_lookup+0x3d>
		return -E_INVAL;
  800ea4:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800ea9:	eb f0                	jmp    800e9b <fd_lookup+0x3d>
  800eab:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800eb0:	eb e9                	jmp    800e9b <fd_lookup+0x3d>

00800eb2 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800eb2:	f3 0f 1e fb          	endbr32 
  800eb6:	55                   	push   %ebp
  800eb7:	89 e5                	mov    %esp,%ebp
  800eb9:	83 ec 08             	sub    $0x8,%esp
  800ebc:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800ebf:	ba 48 23 80 00       	mov    $0x802348,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800ec4:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800ec9:	39 08                	cmp    %ecx,(%eax)
  800ecb:	74 33                	je     800f00 <dev_lookup+0x4e>
  800ecd:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800ed0:	8b 02                	mov    (%edx),%eax
  800ed2:	85 c0                	test   %eax,%eax
  800ed4:	75 f3                	jne    800ec9 <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800ed6:	a1 04 40 80 00       	mov    0x804004,%eax
  800edb:	8b 40 48             	mov    0x48(%eax),%eax
  800ede:	83 ec 04             	sub    $0x4,%esp
  800ee1:	51                   	push   %ecx
  800ee2:	50                   	push   %eax
  800ee3:	68 cc 22 80 00       	push   $0x8022cc
  800ee8:	e8 c0 f2 ff ff       	call   8001ad <cprintf>
	*dev = 0;
  800eed:	8b 45 0c             	mov    0xc(%ebp),%eax
  800ef0:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  800ef6:	83 c4 10             	add    $0x10,%esp
  800ef9:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800efe:	c9                   	leave  
  800eff:	c3                   	ret    
			*dev = devtab[i];
  800f00:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800f03:	89 01                	mov    %eax,(%ecx)
			return 0;
  800f05:	b8 00 00 00 00       	mov    $0x0,%eax
  800f0a:	eb f2                	jmp    800efe <dev_lookup+0x4c>

00800f0c <fd_close>:
{
  800f0c:	f3 0f 1e fb          	endbr32 
  800f10:	55                   	push   %ebp
  800f11:	89 e5                	mov    %esp,%ebp
  800f13:	57                   	push   %edi
  800f14:	56                   	push   %esi
  800f15:	53                   	push   %ebx
  800f16:	83 ec 24             	sub    $0x24,%esp
  800f19:	8b 75 08             	mov    0x8(%ebp),%esi
  800f1c:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800f1f:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800f22:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800f23:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  800f29:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800f2c:	50                   	push   %eax
  800f2d:	e8 2c ff ff ff       	call   800e5e <fd_lookup>
  800f32:	89 c3                	mov    %eax,%ebx
  800f34:	83 c4 10             	add    $0x10,%esp
  800f37:	85 c0                	test   %eax,%eax
  800f39:	78 05                	js     800f40 <fd_close+0x34>
	    || fd != fd2)
  800f3b:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  800f3e:	74 16                	je     800f56 <fd_close+0x4a>
		return (must_exist ? r : 0);
  800f40:	89 f8                	mov    %edi,%eax
  800f42:	84 c0                	test   %al,%al
  800f44:	b8 00 00 00 00       	mov    $0x0,%eax
  800f49:	0f 44 d8             	cmove  %eax,%ebx
}
  800f4c:	89 d8                	mov    %ebx,%eax
  800f4e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f51:	5b                   	pop    %ebx
  800f52:	5e                   	pop    %esi
  800f53:	5f                   	pop    %edi
  800f54:	5d                   	pop    %ebp
  800f55:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  800f56:	83 ec 08             	sub    $0x8,%esp
  800f59:	8d 45 e0             	lea    -0x20(%ebp),%eax
  800f5c:	50                   	push   %eax
  800f5d:	ff 36                	pushl  (%esi)
  800f5f:	e8 4e ff ff ff       	call   800eb2 <dev_lookup>
  800f64:	89 c3                	mov    %eax,%ebx
  800f66:	83 c4 10             	add    $0x10,%esp
  800f69:	85 c0                	test   %eax,%eax
  800f6b:	78 1a                	js     800f87 <fd_close+0x7b>
		if (dev->dev_close)
  800f6d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800f70:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  800f73:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  800f78:	85 c0                	test   %eax,%eax
  800f7a:	74 0b                	je     800f87 <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  800f7c:	83 ec 0c             	sub    $0xc,%esp
  800f7f:	56                   	push   %esi
  800f80:	ff d0                	call   *%eax
  800f82:	89 c3                	mov    %eax,%ebx
  800f84:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  800f87:	83 ec 08             	sub    $0x8,%esp
  800f8a:	56                   	push   %esi
  800f8b:	6a 00                	push   $0x0
  800f8d:	e8 c3 fc ff ff       	call   800c55 <sys_page_unmap>
	return r;
  800f92:	83 c4 10             	add    $0x10,%esp
  800f95:	eb b5                	jmp    800f4c <fd_close+0x40>

00800f97 <close>:

int
close(int fdnum)
{
  800f97:	f3 0f 1e fb          	endbr32 
  800f9b:	55                   	push   %ebp
  800f9c:	89 e5                	mov    %esp,%ebp
  800f9e:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800fa1:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800fa4:	50                   	push   %eax
  800fa5:	ff 75 08             	pushl  0x8(%ebp)
  800fa8:	e8 b1 fe ff ff       	call   800e5e <fd_lookup>
  800fad:	83 c4 10             	add    $0x10,%esp
  800fb0:	85 c0                	test   %eax,%eax
  800fb2:	79 02                	jns    800fb6 <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  800fb4:	c9                   	leave  
  800fb5:	c3                   	ret    
		return fd_close(fd, 1);
  800fb6:	83 ec 08             	sub    $0x8,%esp
  800fb9:	6a 01                	push   $0x1
  800fbb:	ff 75 f4             	pushl  -0xc(%ebp)
  800fbe:	e8 49 ff ff ff       	call   800f0c <fd_close>
  800fc3:	83 c4 10             	add    $0x10,%esp
  800fc6:	eb ec                	jmp    800fb4 <close+0x1d>

00800fc8 <close_all>:

void
close_all(void)
{
  800fc8:	f3 0f 1e fb          	endbr32 
  800fcc:	55                   	push   %ebp
  800fcd:	89 e5                	mov    %esp,%ebp
  800fcf:	53                   	push   %ebx
  800fd0:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  800fd3:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  800fd8:	83 ec 0c             	sub    $0xc,%esp
  800fdb:	53                   	push   %ebx
  800fdc:	e8 b6 ff ff ff       	call   800f97 <close>
	for (i = 0; i < MAXFD; i++)
  800fe1:	83 c3 01             	add    $0x1,%ebx
  800fe4:	83 c4 10             	add    $0x10,%esp
  800fe7:	83 fb 20             	cmp    $0x20,%ebx
  800fea:	75 ec                	jne    800fd8 <close_all+0x10>
}
  800fec:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800fef:	c9                   	leave  
  800ff0:	c3                   	ret    

00800ff1 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  800ff1:	f3 0f 1e fb          	endbr32 
  800ff5:	55                   	push   %ebp
  800ff6:	89 e5                	mov    %esp,%ebp
  800ff8:	57                   	push   %edi
  800ff9:	56                   	push   %esi
  800ffa:	53                   	push   %ebx
  800ffb:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  800ffe:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  801001:	50                   	push   %eax
  801002:	ff 75 08             	pushl  0x8(%ebp)
  801005:	e8 54 fe ff ff       	call   800e5e <fd_lookup>
  80100a:	89 c3                	mov    %eax,%ebx
  80100c:	83 c4 10             	add    $0x10,%esp
  80100f:	85 c0                	test   %eax,%eax
  801011:	0f 88 81 00 00 00    	js     801098 <dup+0xa7>
		return r;
	close(newfdnum);
  801017:	83 ec 0c             	sub    $0xc,%esp
  80101a:	ff 75 0c             	pushl  0xc(%ebp)
  80101d:	e8 75 ff ff ff       	call   800f97 <close>

	newfd = INDEX2FD(newfdnum);
  801022:	8b 75 0c             	mov    0xc(%ebp),%esi
  801025:	c1 e6 0c             	shl    $0xc,%esi
  801028:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  80102e:	83 c4 04             	add    $0x4,%esp
  801031:	ff 75 e4             	pushl  -0x1c(%ebp)
  801034:	e8 b4 fd ff ff       	call   800ded <fd2data>
  801039:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  80103b:	89 34 24             	mov    %esi,(%esp)
  80103e:	e8 aa fd ff ff       	call   800ded <fd2data>
  801043:	83 c4 10             	add    $0x10,%esp
  801046:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  801048:	89 d8                	mov    %ebx,%eax
  80104a:	c1 e8 16             	shr    $0x16,%eax
  80104d:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801054:	a8 01                	test   $0x1,%al
  801056:	74 11                	je     801069 <dup+0x78>
  801058:	89 d8                	mov    %ebx,%eax
  80105a:	c1 e8 0c             	shr    $0xc,%eax
  80105d:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801064:	f6 c2 01             	test   $0x1,%dl
  801067:	75 39                	jne    8010a2 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  801069:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80106c:	89 d0                	mov    %edx,%eax
  80106e:	c1 e8 0c             	shr    $0xc,%eax
  801071:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801078:	83 ec 0c             	sub    $0xc,%esp
  80107b:	25 07 0e 00 00       	and    $0xe07,%eax
  801080:	50                   	push   %eax
  801081:	56                   	push   %esi
  801082:	6a 00                	push   $0x0
  801084:	52                   	push   %edx
  801085:	6a 00                	push   $0x0
  801087:	e8 83 fb ff ff       	call   800c0f <sys_page_map>
  80108c:	89 c3                	mov    %eax,%ebx
  80108e:	83 c4 20             	add    $0x20,%esp
  801091:	85 c0                	test   %eax,%eax
  801093:	78 31                	js     8010c6 <dup+0xd5>
		goto err;

	return newfdnum;
  801095:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  801098:	89 d8                	mov    %ebx,%eax
  80109a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80109d:	5b                   	pop    %ebx
  80109e:	5e                   	pop    %esi
  80109f:	5f                   	pop    %edi
  8010a0:	5d                   	pop    %ebp
  8010a1:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  8010a2:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  8010a9:	83 ec 0c             	sub    $0xc,%esp
  8010ac:	25 07 0e 00 00       	and    $0xe07,%eax
  8010b1:	50                   	push   %eax
  8010b2:	57                   	push   %edi
  8010b3:	6a 00                	push   $0x0
  8010b5:	53                   	push   %ebx
  8010b6:	6a 00                	push   $0x0
  8010b8:	e8 52 fb ff ff       	call   800c0f <sys_page_map>
  8010bd:	89 c3                	mov    %eax,%ebx
  8010bf:	83 c4 20             	add    $0x20,%esp
  8010c2:	85 c0                	test   %eax,%eax
  8010c4:	79 a3                	jns    801069 <dup+0x78>
	sys_page_unmap(0, newfd);
  8010c6:	83 ec 08             	sub    $0x8,%esp
  8010c9:	56                   	push   %esi
  8010ca:	6a 00                	push   $0x0
  8010cc:	e8 84 fb ff ff       	call   800c55 <sys_page_unmap>
	sys_page_unmap(0, nva);
  8010d1:	83 c4 08             	add    $0x8,%esp
  8010d4:	57                   	push   %edi
  8010d5:	6a 00                	push   $0x0
  8010d7:	e8 79 fb ff ff       	call   800c55 <sys_page_unmap>
	return r;
  8010dc:	83 c4 10             	add    $0x10,%esp
  8010df:	eb b7                	jmp    801098 <dup+0xa7>

008010e1 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8010e1:	f3 0f 1e fb          	endbr32 
  8010e5:	55                   	push   %ebp
  8010e6:	89 e5                	mov    %esp,%ebp
  8010e8:	53                   	push   %ebx
  8010e9:	83 ec 1c             	sub    $0x1c,%esp
  8010ec:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8010ef:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8010f2:	50                   	push   %eax
  8010f3:	53                   	push   %ebx
  8010f4:	e8 65 fd ff ff       	call   800e5e <fd_lookup>
  8010f9:	83 c4 10             	add    $0x10,%esp
  8010fc:	85 c0                	test   %eax,%eax
  8010fe:	78 3f                	js     80113f <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  801100:	83 ec 08             	sub    $0x8,%esp
  801103:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801106:	50                   	push   %eax
  801107:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80110a:	ff 30                	pushl  (%eax)
  80110c:	e8 a1 fd ff ff       	call   800eb2 <dev_lookup>
  801111:	83 c4 10             	add    $0x10,%esp
  801114:	85 c0                	test   %eax,%eax
  801116:	78 27                	js     80113f <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  801118:	8b 55 f0             	mov    -0x10(%ebp),%edx
  80111b:	8b 42 08             	mov    0x8(%edx),%eax
  80111e:	83 e0 03             	and    $0x3,%eax
  801121:	83 f8 01             	cmp    $0x1,%eax
  801124:	74 1e                	je     801144 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  801126:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801129:	8b 40 08             	mov    0x8(%eax),%eax
  80112c:	85 c0                	test   %eax,%eax
  80112e:	74 35                	je     801165 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  801130:	83 ec 04             	sub    $0x4,%esp
  801133:	ff 75 10             	pushl  0x10(%ebp)
  801136:	ff 75 0c             	pushl  0xc(%ebp)
  801139:	52                   	push   %edx
  80113a:	ff d0                	call   *%eax
  80113c:	83 c4 10             	add    $0x10,%esp
}
  80113f:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801142:	c9                   	leave  
  801143:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  801144:	a1 04 40 80 00       	mov    0x804004,%eax
  801149:	8b 40 48             	mov    0x48(%eax),%eax
  80114c:	83 ec 04             	sub    $0x4,%esp
  80114f:	53                   	push   %ebx
  801150:	50                   	push   %eax
  801151:	68 0d 23 80 00       	push   $0x80230d
  801156:	e8 52 f0 ff ff       	call   8001ad <cprintf>
		return -E_INVAL;
  80115b:	83 c4 10             	add    $0x10,%esp
  80115e:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801163:	eb da                	jmp    80113f <read+0x5e>
		return -E_NOT_SUPP;
  801165:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80116a:	eb d3                	jmp    80113f <read+0x5e>

0080116c <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  80116c:	f3 0f 1e fb          	endbr32 
  801170:	55                   	push   %ebp
  801171:	89 e5                	mov    %esp,%ebp
  801173:	57                   	push   %edi
  801174:	56                   	push   %esi
  801175:	53                   	push   %ebx
  801176:	83 ec 0c             	sub    $0xc,%esp
  801179:	8b 7d 08             	mov    0x8(%ebp),%edi
  80117c:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  80117f:	bb 00 00 00 00       	mov    $0x0,%ebx
  801184:	eb 02                	jmp    801188 <readn+0x1c>
  801186:	01 c3                	add    %eax,%ebx
  801188:	39 f3                	cmp    %esi,%ebx
  80118a:	73 21                	jae    8011ad <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  80118c:	83 ec 04             	sub    $0x4,%esp
  80118f:	89 f0                	mov    %esi,%eax
  801191:	29 d8                	sub    %ebx,%eax
  801193:	50                   	push   %eax
  801194:	89 d8                	mov    %ebx,%eax
  801196:	03 45 0c             	add    0xc(%ebp),%eax
  801199:	50                   	push   %eax
  80119a:	57                   	push   %edi
  80119b:	e8 41 ff ff ff       	call   8010e1 <read>
		if (m < 0)
  8011a0:	83 c4 10             	add    $0x10,%esp
  8011a3:	85 c0                	test   %eax,%eax
  8011a5:	78 04                	js     8011ab <readn+0x3f>
			return m;
		if (m == 0)
  8011a7:	75 dd                	jne    801186 <readn+0x1a>
  8011a9:	eb 02                	jmp    8011ad <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  8011ab:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  8011ad:	89 d8                	mov    %ebx,%eax
  8011af:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8011b2:	5b                   	pop    %ebx
  8011b3:	5e                   	pop    %esi
  8011b4:	5f                   	pop    %edi
  8011b5:	5d                   	pop    %ebp
  8011b6:	c3                   	ret    

008011b7 <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  8011b7:	f3 0f 1e fb          	endbr32 
  8011bb:	55                   	push   %ebp
  8011bc:	89 e5                	mov    %esp,%ebp
  8011be:	53                   	push   %ebx
  8011bf:	83 ec 1c             	sub    $0x1c,%esp
  8011c2:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8011c5:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8011c8:	50                   	push   %eax
  8011c9:	53                   	push   %ebx
  8011ca:	e8 8f fc ff ff       	call   800e5e <fd_lookup>
  8011cf:	83 c4 10             	add    $0x10,%esp
  8011d2:	85 c0                	test   %eax,%eax
  8011d4:	78 3a                	js     801210 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8011d6:	83 ec 08             	sub    $0x8,%esp
  8011d9:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8011dc:	50                   	push   %eax
  8011dd:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011e0:	ff 30                	pushl  (%eax)
  8011e2:	e8 cb fc ff ff       	call   800eb2 <dev_lookup>
  8011e7:	83 c4 10             	add    $0x10,%esp
  8011ea:	85 c0                	test   %eax,%eax
  8011ec:	78 22                	js     801210 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8011ee:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011f1:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8011f5:	74 1e                	je     801215 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8011f7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8011fa:	8b 52 0c             	mov    0xc(%edx),%edx
  8011fd:	85 d2                	test   %edx,%edx
  8011ff:	74 35                	je     801236 <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  801201:	83 ec 04             	sub    $0x4,%esp
  801204:	ff 75 10             	pushl  0x10(%ebp)
  801207:	ff 75 0c             	pushl  0xc(%ebp)
  80120a:	50                   	push   %eax
  80120b:	ff d2                	call   *%edx
  80120d:	83 c4 10             	add    $0x10,%esp
}
  801210:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801213:	c9                   	leave  
  801214:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  801215:	a1 04 40 80 00       	mov    0x804004,%eax
  80121a:	8b 40 48             	mov    0x48(%eax),%eax
  80121d:	83 ec 04             	sub    $0x4,%esp
  801220:	53                   	push   %ebx
  801221:	50                   	push   %eax
  801222:	68 29 23 80 00       	push   $0x802329
  801227:	e8 81 ef ff ff       	call   8001ad <cprintf>
		return -E_INVAL;
  80122c:	83 c4 10             	add    $0x10,%esp
  80122f:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801234:	eb da                	jmp    801210 <write+0x59>
		return -E_NOT_SUPP;
  801236:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80123b:	eb d3                	jmp    801210 <write+0x59>

0080123d <seek>:

int
seek(int fdnum, off_t offset)
{
  80123d:	f3 0f 1e fb          	endbr32 
  801241:	55                   	push   %ebp
  801242:	89 e5                	mov    %esp,%ebp
  801244:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801247:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80124a:	50                   	push   %eax
  80124b:	ff 75 08             	pushl  0x8(%ebp)
  80124e:	e8 0b fc ff ff       	call   800e5e <fd_lookup>
  801253:	83 c4 10             	add    $0x10,%esp
  801256:	85 c0                	test   %eax,%eax
  801258:	78 0e                	js     801268 <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  80125a:	8b 55 0c             	mov    0xc(%ebp),%edx
  80125d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801260:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801263:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801268:	c9                   	leave  
  801269:	c3                   	ret    

0080126a <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  80126a:	f3 0f 1e fb          	endbr32 
  80126e:	55                   	push   %ebp
  80126f:	89 e5                	mov    %esp,%ebp
  801271:	53                   	push   %ebx
  801272:	83 ec 1c             	sub    $0x1c,%esp
  801275:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  801278:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80127b:	50                   	push   %eax
  80127c:	53                   	push   %ebx
  80127d:	e8 dc fb ff ff       	call   800e5e <fd_lookup>
  801282:	83 c4 10             	add    $0x10,%esp
  801285:	85 c0                	test   %eax,%eax
  801287:	78 37                	js     8012c0 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  801289:	83 ec 08             	sub    $0x8,%esp
  80128c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80128f:	50                   	push   %eax
  801290:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801293:	ff 30                	pushl  (%eax)
  801295:	e8 18 fc ff ff       	call   800eb2 <dev_lookup>
  80129a:	83 c4 10             	add    $0x10,%esp
  80129d:	85 c0                	test   %eax,%eax
  80129f:	78 1f                	js     8012c0 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8012a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012a4:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8012a8:	74 1b                	je     8012c5 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  8012aa:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8012ad:	8b 52 18             	mov    0x18(%edx),%edx
  8012b0:	85 d2                	test   %edx,%edx
  8012b2:	74 32                	je     8012e6 <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  8012b4:	83 ec 08             	sub    $0x8,%esp
  8012b7:	ff 75 0c             	pushl  0xc(%ebp)
  8012ba:	50                   	push   %eax
  8012bb:	ff d2                	call   *%edx
  8012bd:	83 c4 10             	add    $0x10,%esp
}
  8012c0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8012c3:	c9                   	leave  
  8012c4:	c3                   	ret    
			thisenv->env_id, fdnum);
  8012c5:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  8012ca:	8b 40 48             	mov    0x48(%eax),%eax
  8012cd:	83 ec 04             	sub    $0x4,%esp
  8012d0:	53                   	push   %ebx
  8012d1:	50                   	push   %eax
  8012d2:	68 ec 22 80 00       	push   $0x8022ec
  8012d7:	e8 d1 ee ff ff       	call   8001ad <cprintf>
		return -E_INVAL;
  8012dc:	83 c4 10             	add    $0x10,%esp
  8012df:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8012e4:	eb da                	jmp    8012c0 <ftruncate+0x56>
		return -E_NOT_SUPP;
  8012e6:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8012eb:	eb d3                	jmp    8012c0 <ftruncate+0x56>

008012ed <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8012ed:	f3 0f 1e fb          	endbr32 
  8012f1:	55                   	push   %ebp
  8012f2:	89 e5                	mov    %esp,%ebp
  8012f4:	53                   	push   %ebx
  8012f5:	83 ec 1c             	sub    $0x1c,%esp
  8012f8:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012fb:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012fe:	50                   	push   %eax
  8012ff:	ff 75 08             	pushl  0x8(%ebp)
  801302:	e8 57 fb ff ff       	call   800e5e <fd_lookup>
  801307:	83 c4 10             	add    $0x10,%esp
  80130a:	85 c0                	test   %eax,%eax
  80130c:	78 4b                	js     801359 <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80130e:	83 ec 08             	sub    $0x8,%esp
  801311:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801314:	50                   	push   %eax
  801315:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801318:	ff 30                	pushl  (%eax)
  80131a:	e8 93 fb ff ff       	call   800eb2 <dev_lookup>
  80131f:	83 c4 10             	add    $0x10,%esp
  801322:	85 c0                	test   %eax,%eax
  801324:	78 33                	js     801359 <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  801326:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801329:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  80132d:	74 2f                	je     80135e <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  80132f:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  801332:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  801339:	00 00 00 
	stat->st_isdir = 0;
  80133c:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801343:	00 00 00 
	stat->st_dev = dev;
  801346:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  80134c:	83 ec 08             	sub    $0x8,%esp
  80134f:	53                   	push   %ebx
  801350:	ff 75 f0             	pushl  -0x10(%ebp)
  801353:	ff 50 14             	call   *0x14(%eax)
  801356:	83 c4 10             	add    $0x10,%esp
}
  801359:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80135c:	c9                   	leave  
  80135d:	c3                   	ret    
		return -E_NOT_SUPP;
  80135e:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801363:	eb f4                	jmp    801359 <fstat+0x6c>

00801365 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  801365:	f3 0f 1e fb          	endbr32 
  801369:	55                   	push   %ebp
  80136a:	89 e5                	mov    %esp,%ebp
  80136c:	56                   	push   %esi
  80136d:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  80136e:	83 ec 08             	sub    $0x8,%esp
  801371:	6a 00                	push   $0x0
  801373:	ff 75 08             	pushl  0x8(%ebp)
  801376:	e8 fb 01 00 00       	call   801576 <open>
  80137b:	89 c3                	mov    %eax,%ebx
  80137d:	83 c4 10             	add    $0x10,%esp
  801380:	85 c0                	test   %eax,%eax
  801382:	78 1b                	js     80139f <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  801384:	83 ec 08             	sub    $0x8,%esp
  801387:	ff 75 0c             	pushl  0xc(%ebp)
  80138a:	50                   	push   %eax
  80138b:	e8 5d ff ff ff       	call   8012ed <fstat>
  801390:	89 c6                	mov    %eax,%esi
	close(fd);
  801392:	89 1c 24             	mov    %ebx,(%esp)
  801395:	e8 fd fb ff ff       	call   800f97 <close>
	return r;
  80139a:	83 c4 10             	add    $0x10,%esp
  80139d:	89 f3                	mov    %esi,%ebx
}
  80139f:	89 d8                	mov    %ebx,%eax
  8013a1:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8013a4:	5b                   	pop    %ebx
  8013a5:	5e                   	pop    %esi
  8013a6:	5d                   	pop    %ebp
  8013a7:	c3                   	ret    

008013a8 <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  8013a8:	55                   	push   %ebp
  8013a9:	89 e5                	mov    %esp,%ebp
  8013ab:	56                   	push   %esi
  8013ac:	53                   	push   %ebx
  8013ad:	89 c6                	mov    %eax,%esi
  8013af:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  8013b1:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  8013b8:	74 27                	je     8013e1 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  8013ba:	6a 07                	push   $0x7
  8013bc:	68 00 50 80 00       	push   $0x805000
  8013c1:	56                   	push   %esi
  8013c2:	ff 35 00 40 80 00    	pushl  0x804000
  8013c8:	e8 1c 08 00 00       	call   801be9 <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  8013cd:	83 c4 0c             	add    $0xc,%esp
  8013d0:	6a 00                	push   $0x0
  8013d2:	53                   	push   %ebx
  8013d3:	6a 00                	push   $0x0
  8013d5:	e8 8e 07 00 00       	call   801b68 <ipc_recv>
}
  8013da:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8013dd:	5b                   	pop    %ebx
  8013de:	5e                   	pop    %esi
  8013df:	5d                   	pop    %ebp
  8013e0:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8013e1:	83 ec 0c             	sub    $0xc,%esp
  8013e4:	6a 01                	push   $0x1
  8013e6:	e8 56 08 00 00       	call   801c41 <ipc_find_env>
  8013eb:	a3 00 40 80 00       	mov    %eax,0x804000
  8013f0:	83 c4 10             	add    $0x10,%esp
  8013f3:	eb c5                	jmp    8013ba <fsipc+0x12>

008013f5 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8013f5:	f3 0f 1e fb          	endbr32 
  8013f9:	55                   	push   %ebp
  8013fa:	89 e5                	mov    %esp,%ebp
  8013fc:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8013ff:	8b 45 08             	mov    0x8(%ebp),%eax
  801402:	8b 40 0c             	mov    0xc(%eax),%eax
  801405:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  80140a:	8b 45 0c             	mov    0xc(%ebp),%eax
  80140d:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  801412:	ba 00 00 00 00       	mov    $0x0,%edx
  801417:	b8 02 00 00 00       	mov    $0x2,%eax
  80141c:	e8 87 ff ff ff       	call   8013a8 <fsipc>
}
  801421:	c9                   	leave  
  801422:	c3                   	ret    

00801423 <devfile_flush>:
{
  801423:	f3 0f 1e fb          	endbr32 
  801427:	55                   	push   %ebp
  801428:	89 e5                	mov    %esp,%ebp
  80142a:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  80142d:	8b 45 08             	mov    0x8(%ebp),%eax
  801430:	8b 40 0c             	mov    0xc(%eax),%eax
  801433:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  801438:	ba 00 00 00 00       	mov    $0x0,%edx
  80143d:	b8 06 00 00 00       	mov    $0x6,%eax
  801442:	e8 61 ff ff ff       	call   8013a8 <fsipc>
}
  801447:	c9                   	leave  
  801448:	c3                   	ret    

00801449 <devfile_stat>:
{
  801449:	f3 0f 1e fb          	endbr32 
  80144d:	55                   	push   %ebp
  80144e:	89 e5                	mov    %esp,%ebp
  801450:	53                   	push   %ebx
  801451:	83 ec 04             	sub    $0x4,%esp
  801454:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  801457:	8b 45 08             	mov    0x8(%ebp),%eax
  80145a:	8b 40 0c             	mov    0xc(%eax),%eax
  80145d:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801462:	ba 00 00 00 00       	mov    $0x0,%edx
  801467:	b8 05 00 00 00       	mov    $0x5,%eax
  80146c:	e8 37 ff ff ff       	call   8013a8 <fsipc>
  801471:	85 c0                	test   %eax,%eax
  801473:	78 2c                	js     8014a1 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  801475:	83 ec 08             	sub    $0x8,%esp
  801478:	68 00 50 80 00       	push   $0x805000
  80147d:	53                   	push   %ebx
  80147e:	e8 03 f3 ff ff       	call   800786 <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  801483:	a1 80 50 80 00       	mov    0x805080,%eax
  801488:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  80148e:	a1 84 50 80 00       	mov    0x805084,%eax
  801493:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  801499:	83 c4 10             	add    $0x10,%esp
  80149c:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8014a1:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8014a4:	c9                   	leave  
  8014a5:	c3                   	ret    

008014a6 <devfile_write>:
{
  8014a6:	f3 0f 1e fb          	endbr32 
  8014aa:	55                   	push   %ebp
  8014ab:	89 e5                	mov    %esp,%ebp
  8014ad:	83 ec 0c             	sub    $0xc,%esp
  8014b0:	8b 45 10             	mov    0x10(%ebp),%eax
  8014b3:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  8014b8:	ba f8 0f 00 00       	mov    $0xff8,%edx
  8014bd:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  8014c0:	8b 55 08             	mov    0x8(%ebp),%edx
  8014c3:	8b 52 0c             	mov    0xc(%edx),%edx
  8014c6:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  8014cc:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  8014d1:	50                   	push   %eax
  8014d2:	ff 75 0c             	pushl  0xc(%ebp)
  8014d5:	68 08 50 80 00       	push   $0x805008
  8014da:	e8 5d f4 ff ff       	call   80093c <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8014df:	ba 00 00 00 00       	mov    $0x0,%edx
  8014e4:	b8 04 00 00 00       	mov    $0x4,%eax
  8014e9:	e8 ba fe ff ff       	call   8013a8 <fsipc>
  8014ee:	c9                   	leave  
  8014ef:	c3                   	ret    

008014f0 <devfile_read>:
{
  8014f0:	f3 0f 1e fb          	endbr32 
  8014f4:	55                   	push   %ebp
  8014f5:	89 e5                	mov    %esp,%ebp
  8014f7:	56                   	push   %esi
  8014f8:	53                   	push   %ebx
  8014f9:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  8014fc:	8b 45 08             	mov    0x8(%ebp),%eax
  8014ff:	8b 40 0c             	mov    0xc(%eax),%eax
  801502:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  801507:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  80150d:	ba 00 00 00 00       	mov    $0x0,%edx
  801512:	b8 03 00 00 00       	mov    $0x3,%eax
  801517:	e8 8c fe ff ff       	call   8013a8 <fsipc>
  80151c:	89 c3                	mov    %eax,%ebx
  80151e:	85 c0                	test   %eax,%eax
  801520:	78 1f                	js     801541 <devfile_read+0x51>
	assert(r <= n);
  801522:	39 f0                	cmp    %esi,%eax
  801524:	77 24                	ja     80154a <devfile_read+0x5a>
	assert(r <= PGSIZE);
  801526:	3d 00 10 00 00       	cmp    $0x1000,%eax
  80152b:	7f 33                	jg     801560 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  80152d:	83 ec 04             	sub    $0x4,%esp
  801530:	50                   	push   %eax
  801531:	68 00 50 80 00       	push   $0x805000
  801536:	ff 75 0c             	pushl  0xc(%ebp)
  801539:	e8 fe f3 ff ff       	call   80093c <memmove>
	return r;
  80153e:	83 c4 10             	add    $0x10,%esp
}
  801541:	89 d8                	mov    %ebx,%eax
  801543:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801546:	5b                   	pop    %ebx
  801547:	5e                   	pop    %esi
  801548:	5d                   	pop    %ebp
  801549:	c3                   	ret    
	assert(r <= n);
  80154a:	68 58 23 80 00       	push   $0x802358
  80154f:	68 5f 23 80 00       	push   $0x80235f
  801554:	6a 7c                	push   $0x7c
  801556:	68 74 23 80 00       	push   $0x802374
  80155b:	e8 be 05 00 00       	call   801b1e <_panic>
	assert(r <= PGSIZE);
  801560:	68 7f 23 80 00       	push   $0x80237f
  801565:	68 5f 23 80 00       	push   $0x80235f
  80156a:	6a 7d                	push   $0x7d
  80156c:	68 74 23 80 00       	push   $0x802374
  801571:	e8 a8 05 00 00       	call   801b1e <_panic>

00801576 <open>:
{
  801576:	f3 0f 1e fb          	endbr32 
  80157a:	55                   	push   %ebp
  80157b:	89 e5                	mov    %esp,%ebp
  80157d:	56                   	push   %esi
  80157e:	53                   	push   %ebx
  80157f:	83 ec 1c             	sub    $0x1c,%esp
  801582:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  801585:	56                   	push   %esi
  801586:	e8 b8 f1 ff ff       	call   800743 <strlen>
  80158b:	83 c4 10             	add    $0x10,%esp
  80158e:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  801593:	7f 6c                	jg     801601 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  801595:	83 ec 0c             	sub    $0xc,%esp
  801598:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80159b:	50                   	push   %eax
  80159c:	e8 67 f8 ff ff       	call   800e08 <fd_alloc>
  8015a1:	89 c3                	mov    %eax,%ebx
  8015a3:	83 c4 10             	add    $0x10,%esp
  8015a6:	85 c0                	test   %eax,%eax
  8015a8:	78 3c                	js     8015e6 <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  8015aa:	83 ec 08             	sub    $0x8,%esp
  8015ad:	56                   	push   %esi
  8015ae:	68 00 50 80 00       	push   $0x805000
  8015b3:	e8 ce f1 ff ff       	call   800786 <strcpy>
	fsipcbuf.open.req_omode = mode;
  8015b8:	8b 45 0c             	mov    0xc(%ebp),%eax
  8015bb:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  8015c0:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8015c3:	b8 01 00 00 00       	mov    $0x1,%eax
  8015c8:	e8 db fd ff ff       	call   8013a8 <fsipc>
  8015cd:	89 c3                	mov    %eax,%ebx
  8015cf:	83 c4 10             	add    $0x10,%esp
  8015d2:	85 c0                	test   %eax,%eax
  8015d4:	78 19                	js     8015ef <open+0x79>
	return fd2num(fd);
  8015d6:	83 ec 0c             	sub    $0xc,%esp
  8015d9:	ff 75 f4             	pushl  -0xc(%ebp)
  8015dc:	e8 f8 f7 ff ff       	call   800dd9 <fd2num>
  8015e1:	89 c3                	mov    %eax,%ebx
  8015e3:	83 c4 10             	add    $0x10,%esp
}
  8015e6:	89 d8                	mov    %ebx,%eax
  8015e8:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8015eb:	5b                   	pop    %ebx
  8015ec:	5e                   	pop    %esi
  8015ed:	5d                   	pop    %ebp
  8015ee:	c3                   	ret    
		fd_close(fd, 0);
  8015ef:	83 ec 08             	sub    $0x8,%esp
  8015f2:	6a 00                	push   $0x0
  8015f4:	ff 75 f4             	pushl  -0xc(%ebp)
  8015f7:	e8 10 f9 ff ff       	call   800f0c <fd_close>
		return r;
  8015fc:	83 c4 10             	add    $0x10,%esp
  8015ff:	eb e5                	jmp    8015e6 <open+0x70>
		return -E_BAD_PATH;
  801601:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  801606:	eb de                	jmp    8015e6 <open+0x70>

00801608 <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  801608:	f3 0f 1e fb          	endbr32 
  80160c:	55                   	push   %ebp
  80160d:	89 e5                	mov    %esp,%ebp
  80160f:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  801612:	ba 00 00 00 00       	mov    $0x0,%edx
  801617:	b8 08 00 00 00       	mov    $0x8,%eax
  80161c:	e8 87 fd ff ff       	call   8013a8 <fsipc>
}
  801621:	c9                   	leave  
  801622:	c3                   	ret    

00801623 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  801623:	f3 0f 1e fb          	endbr32 
  801627:	55                   	push   %ebp
  801628:	89 e5                	mov    %esp,%ebp
  80162a:	56                   	push   %esi
  80162b:	53                   	push   %ebx
  80162c:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  80162f:	83 ec 0c             	sub    $0xc,%esp
  801632:	ff 75 08             	pushl  0x8(%ebp)
  801635:	e8 b3 f7 ff ff       	call   800ded <fd2data>
  80163a:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  80163c:	83 c4 08             	add    $0x8,%esp
  80163f:	68 8b 23 80 00       	push   $0x80238b
  801644:	53                   	push   %ebx
  801645:	e8 3c f1 ff ff       	call   800786 <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  80164a:	8b 46 04             	mov    0x4(%esi),%eax
  80164d:	2b 06                	sub    (%esi),%eax
  80164f:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  801655:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  80165c:	00 00 00 
	stat->st_dev = &devpipe;
  80165f:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  801666:	30 80 00 
	return 0;
}
  801669:	b8 00 00 00 00       	mov    $0x0,%eax
  80166e:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801671:	5b                   	pop    %ebx
  801672:	5e                   	pop    %esi
  801673:	5d                   	pop    %ebp
  801674:	c3                   	ret    

00801675 <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801675:	f3 0f 1e fb          	endbr32 
  801679:	55                   	push   %ebp
  80167a:	89 e5                	mov    %esp,%ebp
  80167c:	53                   	push   %ebx
  80167d:	83 ec 0c             	sub    $0xc,%esp
  801680:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801683:	53                   	push   %ebx
  801684:	6a 00                	push   $0x0
  801686:	e8 ca f5 ff ff       	call   800c55 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  80168b:	89 1c 24             	mov    %ebx,(%esp)
  80168e:	e8 5a f7 ff ff       	call   800ded <fd2data>
  801693:	83 c4 08             	add    $0x8,%esp
  801696:	50                   	push   %eax
  801697:	6a 00                	push   $0x0
  801699:	e8 b7 f5 ff ff       	call   800c55 <sys_page_unmap>
}
  80169e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8016a1:	c9                   	leave  
  8016a2:	c3                   	ret    

008016a3 <_pipeisclosed>:
{
  8016a3:	55                   	push   %ebp
  8016a4:	89 e5                	mov    %esp,%ebp
  8016a6:	57                   	push   %edi
  8016a7:	56                   	push   %esi
  8016a8:	53                   	push   %ebx
  8016a9:	83 ec 1c             	sub    $0x1c,%esp
  8016ac:	89 c7                	mov    %eax,%edi
  8016ae:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  8016b0:	a1 04 40 80 00       	mov    0x804004,%eax
  8016b5:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  8016b8:	83 ec 0c             	sub    $0xc,%esp
  8016bb:	57                   	push   %edi
  8016bc:	e8 bd 05 00 00       	call   801c7e <pageref>
  8016c1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8016c4:	89 34 24             	mov    %esi,(%esp)
  8016c7:	e8 b2 05 00 00       	call   801c7e <pageref>
		nn = thisenv->env_runs;
  8016cc:	8b 15 04 40 80 00    	mov    0x804004,%edx
  8016d2:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  8016d5:	83 c4 10             	add    $0x10,%esp
  8016d8:	39 cb                	cmp    %ecx,%ebx
  8016da:	74 1b                	je     8016f7 <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  8016dc:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016df:	75 cf                	jne    8016b0 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  8016e1:	8b 42 58             	mov    0x58(%edx),%eax
  8016e4:	6a 01                	push   $0x1
  8016e6:	50                   	push   %eax
  8016e7:	53                   	push   %ebx
  8016e8:	68 92 23 80 00       	push   $0x802392
  8016ed:	e8 bb ea ff ff       	call   8001ad <cprintf>
  8016f2:	83 c4 10             	add    $0x10,%esp
  8016f5:	eb b9                	jmp    8016b0 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  8016f7:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016fa:	0f 94 c0             	sete   %al
  8016fd:	0f b6 c0             	movzbl %al,%eax
}
  801700:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801703:	5b                   	pop    %ebx
  801704:	5e                   	pop    %esi
  801705:	5f                   	pop    %edi
  801706:	5d                   	pop    %ebp
  801707:	c3                   	ret    

00801708 <devpipe_write>:
{
  801708:	f3 0f 1e fb          	endbr32 
  80170c:	55                   	push   %ebp
  80170d:	89 e5                	mov    %esp,%ebp
  80170f:	57                   	push   %edi
  801710:	56                   	push   %esi
  801711:	53                   	push   %ebx
  801712:	83 ec 28             	sub    $0x28,%esp
  801715:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  801718:	56                   	push   %esi
  801719:	e8 cf f6 ff ff       	call   800ded <fd2data>
  80171e:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  801720:	83 c4 10             	add    $0x10,%esp
  801723:	bf 00 00 00 00       	mov    $0x0,%edi
  801728:	3b 7d 10             	cmp    0x10(%ebp),%edi
  80172b:	74 4f                	je     80177c <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  80172d:	8b 43 04             	mov    0x4(%ebx),%eax
  801730:	8b 0b                	mov    (%ebx),%ecx
  801732:	8d 51 20             	lea    0x20(%ecx),%edx
  801735:	39 d0                	cmp    %edx,%eax
  801737:	72 14                	jb     80174d <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  801739:	89 da                	mov    %ebx,%edx
  80173b:	89 f0                	mov    %esi,%eax
  80173d:	e8 61 ff ff ff       	call   8016a3 <_pipeisclosed>
  801742:	85 c0                	test   %eax,%eax
  801744:	75 3b                	jne    801781 <devpipe_write+0x79>
			sys_yield();
  801746:	e8 5a f4 ff ff       	call   800ba5 <sys_yield>
  80174b:	eb e0                	jmp    80172d <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  80174d:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801750:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801754:	88 4d e7             	mov    %cl,-0x19(%ebp)
  801757:	89 c2                	mov    %eax,%edx
  801759:	c1 fa 1f             	sar    $0x1f,%edx
  80175c:	89 d1                	mov    %edx,%ecx
  80175e:	c1 e9 1b             	shr    $0x1b,%ecx
  801761:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801764:	83 e2 1f             	and    $0x1f,%edx
  801767:	29 ca                	sub    %ecx,%edx
  801769:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  80176d:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801771:	83 c0 01             	add    $0x1,%eax
  801774:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  801777:	83 c7 01             	add    $0x1,%edi
  80177a:	eb ac                	jmp    801728 <devpipe_write+0x20>
	return i;
  80177c:	8b 45 10             	mov    0x10(%ebp),%eax
  80177f:	eb 05                	jmp    801786 <devpipe_write+0x7e>
				return 0;
  801781:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801786:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801789:	5b                   	pop    %ebx
  80178a:	5e                   	pop    %esi
  80178b:	5f                   	pop    %edi
  80178c:	5d                   	pop    %ebp
  80178d:	c3                   	ret    

0080178e <devpipe_read>:
{
  80178e:	f3 0f 1e fb          	endbr32 
  801792:	55                   	push   %ebp
  801793:	89 e5                	mov    %esp,%ebp
  801795:	57                   	push   %edi
  801796:	56                   	push   %esi
  801797:	53                   	push   %ebx
  801798:	83 ec 18             	sub    $0x18,%esp
  80179b:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  80179e:	57                   	push   %edi
  80179f:	e8 49 f6 ff ff       	call   800ded <fd2data>
  8017a4:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8017a6:	83 c4 10             	add    $0x10,%esp
  8017a9:	be 00 00 00 00       	mov    $0x0,%esi
  8017ae:	3b 75 10             	cmp    0x10(%ebp),%esi
  8017b1:	75 14                	jne    8017c7 <devpipe_read+0x39>
	return i;
  8017b3:	8b 45 10             	mov    0x10(%ebp),%eax
  8017b6:	eb 02                	jmp    8017ba <devpipe_read+0x2c>
				return i;
  8017b8:	89 f0                	mov    %esi,%eax
}
  8017ba:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8017bd:	5b                   	pop    %ebx
  8017be:	5e                   	pop    %esi
  8017bf:	5f                   	pop    %edi
  8017c0:	5d                   	pop    %ebp
  8017c1:	c3                   	ret    
			sys_yield();
  8017c2:	e8 de f3 ff ff       	call   800ba5 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  8017c7:	8b 03                	mov    (%ebx),%eax
  8017c9:	3b 43 04             	cmp    0x4(%ebx),%eax
  8017cc:	75 18                	jne    8017e6 <devpipe_read+0x58>
			if (i > 0)
  8017ce:	85 f6                	test   %esi,%esi
  8017d0:	75 e6                	jne    8017b8 <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  8017d2:	89 da                	mov    %ebx,%edx
  8017d4:	89 f8                	mov    %edi,%eax
  8017d6:	e8 c8 fe ff ff       	call   8016a3 <_pipeisclosed>
  8017db:	85 c0                	test   %eax,%eax
  8017dd:	74 e3                	je     8017c2 <devpipe_read+0x34>
				return 0;
  8017df:	b8 00 00 00 00       	mov    $0x0,%eax
  8017e4:	eb d4                	jmp    8017ba <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  8017e6:	99                   	cltd   
  8017e7:	c1 ea 1b             	shr    $0x1b,%edx
  8017ea:	01 d0                	add    %edx,%eax
  8017ec:	83 e0 1f             	and    $0x1f,%eax
  8017ef:	29 d0                	sub    %edx,%eax
  8017f1:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  8017f6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8017f9:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  8017fc:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  8017ff:	83 c6 01             	add    $0x1,%esi
  801802:	eb aa                	jmp    8017ae <devpipe_read+0x20>

00801804 <pipe>:
{
  801804:	f3 0f 1e fb          	endbr32 
  801808:	55                   	push   %ebp
  801809:	89 e5                	mov    %esp,%ebp
  80180b:	56                   	push   %esi
  80180c:	53                   	push   %ebx
  80180d:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  801810:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801813:	50                   	push   %eax
  801814:	e8 ef f5 ff ff       	call   800e08 <fd_alloc>
  801819:	89 c3                	mov    %eax,%ebx
  80181b:	83 c4 10             	add    $0x10,%esp
  80181e:	85 c0                	test   %eax,%eax
  801820:	0f 88 23 01 00 00    	js     801949 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801826:	83 ec 04             	sub    $0x4,%esp
  801829:	68 07 04 00 00       	push   $0x407
  80182e:	ff 75 f4             	pushl  -0xc(%ebp)
  801831:	6a 00                	push   $0x0
  801833:	e8 90 f3 ff ff       	call   800bc8 <sys_page_alloc>
  801838:	89 c3                	mov    %eax,%ebx
  80183a:	83 c4 10             	add    $0x10,%esp
  80183d:	85 c0                	test   %eax,%eax
  80183f:	0f 88 04 01 00 00    	js     801949 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  801845:	83 ec 0c             	sub    $0xc,%esp
  801848:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80184b:	50                   	push   %eax
  80184c:	e8 b7 f5 ff ff       	call   800e08 <fd_alloc>
  801851:	89 c3                	mov    %eax,%ebx
  801853:	83 c4 10             	add    $0x10,%esp
  801856:	85 c0                	test   %eax,%eax
  801858:	0f 88 db 00 00 00    	js     801939 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80185e:	83 ec 04             	sub    $0x4,%esp
  801861:	68 07 04 00 00       	push   $0x407
  801866:	ff 75 f0             	pushl  -0x10(%ebp)
  801869:	6a 00                	push   $0x0
  80186b:	e8 58 f3 ff ff       	call   800bc8 <sys_page_alloc>
  801870:	89 c3                	mov    %eax,%ebx
  801872:	83 c4 10             	add    $0x10,%esp
  801875:	85 c0                	test   %eax,%eax
  801877:	0f 88 bc 00 00 00    	js     801939 <pipe+0x135>
	va = fd2data(fd0);
  80187d:	83 ec 0c             	sub    $0xc,%esp
  801880:	ff 75 f4             	pushl  -0xc(%ebp)
  801883:	e8 65 f5 ff ff       	call   800ded <fd2data>
  801888:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80188a:	83 c4 0c             	add    $0xc,%esp
  80188d:	68 07 04 00 00       	push   $0x407
  801892:	50                   	push   %eax
  801893:	6a 00                	push   $0x0
  801895:	e8 2e f3 ff ff       	call   800bc8 <sys_page_alloc>
  80189a:	89 c3                	mov    %eax,%ebx
  80189c:	83 c4 10             	add    $0x10,%esp
  80189f:	85 c0                	test   %eax,%eax
  8018a1:	0f 88 82 00 00 00    	js     801929 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8018a7:	83 ec 0c             	sub    $0xc,%esp
  8018aa:	ff 75 f0             	pushl  -0x10(%ebp)
  8018ad:	e8 3b f5 ff ff       	call   800ded <fd2data>
  8018b2:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  8018b9:	50                   	push   %eax
  8018ba:	6a 00                	push   $0x0
  8018bc:	56                   	push   %esi
  8018bd:	6a 00                	push   $0x0
  8018bf:	e8 4b f3 ff ff       	call   800c0f <sys_page_map>
  8018c4:	89 c3                	mov    %eax,%ebx
  8018c6:	83 c4 20             	add    $0x20,%esp
  8018c9:	85 c0                	test   %eax,%eax
  8018cb:	78 4e                	js     80191b <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  8018cd:	a1 20 30 80 00       	mov    0x803020,%eax
  8018d2:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8018d5:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  8018d7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8018da:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  8018e1:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8018e4:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  8018e6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8018e9:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  8018f0:	83 ec 0c             	sub    $0xc,%esp
  8018f3:	ff 75 f4             	pushl  -0xc(%ebp)
  8018f6:	e8 de f4 ff ff       	call   800dd9 <fd2num>
  8018fb:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018fe:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  801900:	83 c4 04             	add    $0x4,%esp
  801903:	ff 75 f0             	pushl  -0x10(%ebp)
  801906:	e8 ce f4 ff ff       	call   800dd9 <fd2num>
  80190b:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80190e:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  801911:	83 c4 10             	add    $0x10,%esp
  801914:	bb 00 00 00 00       	mov    $0x0,%ebx
  801919:	eb 2e                	jmp    801949 <pipe+0x145>
	sys_page_unmap(0, va);
  80191b:	83 ec 08             	sub    $0x8,%esp
  80191e:	56                   	push   %esi
  80191f:	6a 00                	push   $0x0
  801921:	e8 2f f3 ff ff       	call   800c55 <sys_page_unmap>
  801926:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  801929:	83 ec 08             	sub    $0x8,%esp
  80192c:	ff 75 f0             	pushl  -0x10(%ebp)
  80192f:	6a 00                	push   $0x0
  801931:	e8 1f f3 ff ff       	call   800c55 <sys_page_unmap>
  801936:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  801939:	83 ec 08             	sub    $0x8,%esp
  80193c:	ff 75 f4             	pushl  -0xc(%ebp)
  80193f:	6a 00                	push   $0x0
  801941:	e8 0f f3 ff ff       	call   800c55 <sys_page_unmap>
  801946:	83 c4 10             	add    $0x10,%esp
}
  801949:	89 d8                	mov    %ebx,%eax
  80194b:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80194e:	5b                   	pop    %ebx
  80194f:	5e                   	pop    %esi
  801950:	5d                   	pop    %ebp
  801951:	c3                   	ret    

00801952 <pipeisclosed>:
{
  801952:	f3 0f 1e fb          	endbr32 
  801956:	55                   	push   %ebp
  801957:	89 e5                	mov    %esp,%ebp
  801959:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80195c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80195f:	50                   	push   %eax
  801960:	ff 75 08             	pushl  0x8(%ebp)
  801963:	e8 f6 f4 ff ff       	call   800e5e <fd_lookup>
  801968:	83 c4 10             	add    $0x10,%esp
  80196b:	85 c0                	test   %eax,%eax
  80196d:	78 18                	js     801987 <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  80196f:	83 ec 0c             	sub    $0xc,%esp
  801972:	ff 75 f4             	pushl  -0xc(%ebp)
  801975:	e8 73 f4 ff ff       	call   800ded <fd2data>
  80197a:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  80197c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80197f:	e8 1f fd ff ff       	call   8016a3 <_pipeisclosed>
  801984:	83 c4 10             	add    $0x10,%esp
}
  801987:	c9                   	leave  
  801988:	c3                   	ret    

00801989 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  801989:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  80198d:	b8 00 00 00 00       	mov    $0x0,%eax
  801992:	c3                   	ret    

00801993 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801993:	f3 0f 1e fb          	endbr32 
  801997:	55                   	push   %ebp
  801998:	89 e5                	mov    %esp,%ebp
  80199a:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  80199d:	68 aa 23 80 00       	push   $0x8023aa
  8019a2:	ff 75 0c             	pushl  0xc(%ebp)
  8019a5:	e8 dc ed ff ff       	call   800786 <strcpy>
	return 0;
}
  8019aa:	b8 00 00 00 00       	mov    $0x0,%eax
  8019af:	c9                   	leave  
  8019b0:	c3                   	ret    

008019b1 <devcons_write>:
{
  8019b1:	f3 0f 1e fb          	endbr32 
  8019b5:	55                   	push   %ebp
  8019b6:	89 e5                	mov    %esp,%ebp
  8019b8:	57                   	push   %edi
  8019b9:	56                   	push   %esi
  8019ba:	53                   	push   %ebx
  8019bb:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  8019c1:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  8019c6:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  8019cc:	3b 75 10             	cmp    0x10(%ebp),%esi
  8019cf:	73 31                	jae    801a02 <devcons_write+0x51>
		m = n - tot;
  8019d1:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8019d4:	29 f3                	sub    %esi,%ebx
  8019d6:	83 fb 7f             	cmp    $0x7f,%ebx
  8019d9:	b8 7f 00 00 00       	mov    $0x7f,%eax
  8019de:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  8019e1:	83 ec 04             	sub    $0x4,%esp
  8019e4:	53                   	push   %ebx
  8019e5:	89 f0                	mov    %esi,%eax
  8019e7:	03 45 0c             	add    0xc(%ebp),%eax
  8019ea:	50                   	push   %eax
  8019eb:	57                   	push   %edi
  8019ec:	e8 4b ef ff ff       	call   80093c <memmove>
		sys_cputs(buf, m);
  8019f1:	83 c4 08             	add    $0x8,%esp
  8019f4:	53                   	push   %ebx
  8019f5:	57                   	push   %edi
  8019f6:	e8 fd f0 ff ff       	call   800af8 <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  8019fb:	01 de                	add    %ebx,%esi
  8019fd:	83 c4 10             	add    $0x10,%esp
  801a00:	eb ca                	jmp    8019cc <devcons_write+0x1b>
}
  801a02:	89 f0                	mov    %esi,%eax
  801a04:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801a07:	5b                   	pop    %ebx
  801a08:	5e                   	pop    %esi
  801a09:	5f                   	pop    %edi
  801a0a:	5d                   	pop    %ebp
  801a0b:	c3                   	ret    

00801a0c <devcons_read>:
{
  801a0c:	f3 0f 1e fb          	endbr32 
  801a10:	55                   	push   %ebp
  801a11:	89 e5                	mov    %esp,%ebp
  801a13:	83 ec 08             	sub    $0x8,%esp
  801a16:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  801a1b:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  801a1f:	74 21                	je     801a42 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  801a21:	e8 f4 f0 ff ff       	call   800b1a <sys_cgetc>
  801a26:	85 c0                	test   %eax,%eax
  801a28:	75 07                	jne    801a31 <devcons_read+0x25>
		sys_yield();
  801a2a:	e8 76 f1 ff ff       	call   800ba5 <sys_yield>
  801a2f:	eb f0                	jmp    801a21 <devcons_read+0x15>
	if (c < 0)
  801a31:	78 0f                	js     801a42 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  801a33:	83 f8 04             	cmp    $0x4,%eax
  801a36:	74 0c                	je     801a44 <devcons_read+0x38>
	*(char*)vbuf = c;
  801a38:	8b 55 0c             	mov    0xc(%ebp),%edx
  801a3b:	88 02                	mov    %al,(%edx)
	return 1;
  801a3d:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801a42:	c9                   	leave  
  801a43:	c3                   	ret    
		return 0;
  801a44:	b8 00 00 00 00       	mov    $0x0,%eax
  801a49:	eb f7                	jmp    801a42 <devcons_read+0x36>

00801a4b <cputchar>:
{
  801a4b:	f3 0f 1e fb          	endbr32 
  801a4f:	55                   	push   %ebp
  801a50:	89 e5                	mov    %esp,%ebp
  801a52:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801a55:	8b 45 08             	mov    0x8(%ebp),%eax
  801a58:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801a5b:	6a 01                	push   $0x1
  801a5d:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a60:	50                   	push   %eax
  801a61:	e8 92 f0 ff ff       	call   800af8 <sys_cputs>
}
  801a66:	83 c4 10             	add    $0x10,%esp
  801a69:	c9                   	leave  
  801a6a:	c3                   	ret    

00801a6b <getchar>:
{
  801a6b:	f3 0f 1e fb          	endbr32 
  801a6f:	55                   	push   %ebp
  801a70:	89 e5                	mov    %esp,%ebp
  801a72:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801a75:	6a 01                	push   $0x1
  801a77:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a7a:	50                   	push   %eax
  801a7b:	6a 00                	push   $0x0
  801a7d:	e8 5f f6 ff ff       	call   8010e1 <read>
	if (r < 0)
  801a82:	83 c4 10             	add    $0x10,%esp
  801a85:	85 c0                	test   %eax,%eax
  801a87:	78 06                	js     801a8f <getchar+0x24>
	if (r < 1)
  801a89:	74 06                	je     801a91 <getchar+0x26>
	return c;
  801a8b:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801a8f:	c9                   	leave  
  801a90:	c3                   	ret    
		return -E_EOF;
  801a91:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801a96:	eb f7                	jmp    801a8f <getchar+0x24>

00801a98 <iscons>:
{
  801a98:	f3 0f 1e fb          	endbr32 
  801a9c:	55                   	push   %ebp
  801a9d:	89 e5                	mov    %esp,%ebp
  801a9f:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801aa2:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801aa5:	50                   	push   %eax
  801aa6:	ff 75 08             	pushl  0x8(%ebp)
  801aa9:	e8 b0 f3 ff ff       	call   800e5e <fd_lookup>
  801aae:	83 c4 10             	add    $0x10,%esp
  801ab1:	85 c0                	test   %eax,%eax
  801ab3:	78 11                	js     801ac6 <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801ab5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801ab8:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801abe:	39 10                	cmp    %edx,(%eax)
  801ac0:	0f 94 c0             	sete   %al
  801ac3:	0f b6 c0             	movzbl %al,%eax
}
  801ac6:	c9                   	leave  
  801ac7:	c3                   	ret    

00801ac8 <opencons>:
{
  801ac8:	f3 0f 1e fb          	endbr32 
  801acc:	55                   	push   %ebp
  801acd:	89 e5                	mov    %esp,%ebp
  801acf:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801ad2:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801ad5:	50                   	push   %eax
  801ad6:	e8 2d f3 ff ff       	call   800e08 <fd_alloc>
  801adb:	83 c4 10             	add    $0x10,%esp
  801ade:	85 c0                	test   %eax,%eax
  801ae0:	78 3a                	js     801b1c <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801ae2:	83 ec 04             	sub    $0x4,%esp
  801ae5:	68 07 04 00 00       	push   $0x407
  801aea:	ff 75 f4             	pushl  -0xc(%ebp)
  801aed:	6a 00                	push   $0x0
  801aef:	e8 d4 f0 ff ff       	call   800bc8 <sys_page_alloc>
  801af4:	83 c4 10             	add    $0x10,%esp
  801af7:	85 c0                	test   %eax,%eax
  801af9:	78 21                	js     801b1c <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801afb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801afe:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801b04:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801b06:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801b09:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801b10:	83 ec 0c             	sub    $0xc,%esp
  801b13:	50                   	push   %eax
  801b14:	e8 c0 f2 ff ff       	call   800dd9 <fd2num>
  801b19:	83 c4 10             	add    $0x10,%esp
}
  801b1c:	c9                   	leave  
  801b1d:	c3                   	ret    

00801b1e <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  801b1e:	f3 0f 1e fb          	endbr32 
  801b22:	55                   	push   %ebp
  801b23:	89 e5                	mov    %esp,%ebp
  801b25:	56                   	push   %esi
  801b26:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  801b27:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  801b2a:	8b 35 00 30 80 00    	mov    0x803000,%esi
  801b30:	e8 4d f0 ff ff       	call   800b82 <sys_getenvid>
  801b35:	83 ec 0c             	sub    $0xc,%esp
  801b38:	ff 75 0c             	pushl  0xc(%ebp)
  801b3b:	ff 75 08             	pushl  0x8(%ebp)
  801b3e:	56                   	push   %esi
  801b3f:	50                   	push   %eax
  801b40:	68 b8 23 80 00       	push   $0x8023b8
  801b45:	e8 63 e6 ff ff       	call   8001ad <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  801b4a:	83 c4 18             	add    $0x18,%esp
  801b4d:	53                   	push   %ebx
  801b4e:	ff 75 10             	pushl  0x10(%ebp)
  801b51:	e8 02 e6 ff ff       	call   800158 <vcprintf>
	cprintf("\n");
  801b56:	c7 04 24 a3 23 80 00 	movl   $0x8023a3,(%esp)
  801b5d:	e8 4b e6 ff ff       	call   8001ad <cprintf>
  801b62:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  801b65:	cc                   	int3   
  801b66:	eb fd                	jmp    801b65 <_panic+0x47>

00801b68 <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801b68:	f3 0f 1e fb          	endbr32 
  801b6c:	55                   	push   %ebp
  801b6d:	89 e5                	mov    %esp,%ebp
  801b6f:	56                   	push   %esi
  801b70:	53                   	push   %ebx
  801b71:	8b 75 08             	mov    0x8(%ebp),%esi
  801b74:	8b 45 0c             	mov    0xc(%ebp),%eax
  801b77:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801b7a:	85 c0                	test   %eax,%eax
  801b7c:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801b81:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801b84:	83 ec 0c             	sub    $0xc,%esp
  801b87:	50                   	push   %eax
  801b88:	e8 07 f2 ff ff       	call   800d94 <sys_ipc_recv>
  801b8d:	83 c4 10             	add    $0x10,%esp
  801b90:	85 c0                	test   %eax,%eax
  801b92:	78 3f                	js     801bd3 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801b94:	e8 e9 ef ff ff       	call   800b82 <sys_getenvid>
  801b99:	25 ff 03 00 00       	and    $0x3ff,%eax
  801b9e:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801ba1:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801ba7:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801bad:	85 f6                	test   %esi,%esi
  801baf:	74 05                	je     801bb6 <ipc_recv+0x4e>
  801bb1:	8b 42 74             	mov    0x74(%edx),%eax
  801bb4:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801bb6:	85 db                	test   %ebx,%ebx
  801bb8:	74 0a                	je     801bc4 <ipc_recv+0x5c>
  801bba:	a1 04 40 80 00       	mov    0x804004,%eax
  801bbf:	8b 40 78             	mov    0x78(%eax),%eax
  801bc2:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801bc4:	a1 04 40 80 00       	mov    0x804004,%eax
  801bc9:	8b 40 70             	mov    0x70(%eax),%eax
}
  801bcc:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801bcf:	5b                   	pop    %ebx
  801bd0:	5e                   	pop    %esi
  801bd1:	5d                   	pop    %ebp
  801bd2:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801bd3:	85 f6                	test   %esi,%esi
  801bd5:	74 06                	je     801bdd <ipc_recv+0x75>
  801bd7:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801bdd:	85 db                	test   %ebx,%ebx
  801bdf:	74 eb                	je     801bcc <ipc_recv+0x64>
  801be1:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801be7:	eb e3                	jmp    801bcc <ipc_recv+0x64>

00801be9 <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801be9:	f3 0f 1e fb          	endbr32 
  801bed:	55                   	push   %ebp
  801bee:	89 e5                	mov    %esp,%ebp
  801bf0:	57                   	push   %edi
  801bf1:	56                   	push   %esi
  801bf2:	53                   	push   %ebx
  801bf3:	83 ec 0c             	sub    $0xc,%esp
  801bf6:	8b 7d 08             	mov    0x8(%ebp),%edi
  801bf9:	8b 75 0c             	mov    0xc(%ebp),%esi
  801bfc:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801bff:	85 db                	test   %ebx,%ebx
  801c01:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801c06:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801c09:	ff 75 14             	pushl  0x14(%ebp)
  801c0c:	53                   	push   %ebx
  801c0d:	56                   	push   %esi
  801c0e:	57                   	push   %edi
  801c0f:	e8 59 f1 ff ff       	call   800d6d <sys_ipc_try_send>
  801c14:	83 c4 10             	add    $0x10,%esp
  801c17:	85 c0                	test   %eax,%eax
  801c19:	79 1e                	jns    801c39 <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801c1b:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801c1e:	75 07                	jne    801c27 <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801c20:	e8 80 ef ff ff       	call   800ba5 <sys_yield>
  801c25:	eb e2                	jmp    801c09 <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801c27:	50                   	push   %eax
  801c28:	68 db 23 80 00       	push   $0x8023db
  801c2d:	6a 3b                	push   $0x3b
  801c2f:	68 ef 23 80 00       	push   $0x8023ef
  801c34:	e8 e5 fe ff ff       	call   801b1e <_panic>
	}
}
  801c39:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c3c:	5b                   	pop    %ebx
  801c3d:	5e                   	pop    %esi
  801c3e:	5f                   	pop    %edi
  801c3f:	5d                   	pop    %ebp
  801c40:	c3                   	ret    

00801c41 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801c41:	f3 0f 1e fb          	endbr32 
  801c45:	55                   	push   %ebp
  801c46:	89 e5                	mov    %esp,%ebp
  801c48:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801c4b:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801c50:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801c53:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801c59:	8b 52 50             	mov    0x50(%edx),%edx
  801c5c:	39 ca                	cmp    %ecx,%edx
  801c5e:	74 11                	je     801c71 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801c60:	83 c0 01             	add    $0x1,%eax
  801c63:	3d 00 04 00 00       	cmp    $0x400,%eax
  801c68:	75 e6                	jne    801c50 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801c6a:	b8 00 00 00 00       	mov    $0x0,%eax
  801c6f:	eb 0b                	jmp    801c7c <ipc_find_env+0x3b>
			return envs[i].env_id;
  801c71:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801c74:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801c79:	8b 40 48             	mov    0x48(%eax),%eax
}
  801c7c:	5d                   	pop    %ebp
  801c7d:	c3                   	ret    

00801c7e <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801c7e:	f3 0f 1e fb          	endbr32 
  801c82:	55                   	push   %ebp
  801c83:	89 e5                	mov    %esp,%ebp
  801c85:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801c88:	89 c2                	mov    %eax,%edx
  801c8a:	c1 ea 16             	shr    $0x16,%edx
  801c8d:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801c94:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801c99:	f6 c1 01             	test   $0x1,%cl
  801c9c:	74 1c                	je     801cba <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801c9e:	c1 e8 0c             	shr    $0xc,%eax
  801ca1:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801ca8:	a8 01                	test   $0x1,%al
  801caa:	74 0e                	je     801cba <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801cac:	c1 e8 0c             	shr    $0xc,%eax
  801caf:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801cb6:	ef 
  801cb7:	0f b7 d2             	movzwl %dx,%edx
}
  801cba:	89 d0                	mov    %edx,%eax
  801cbc:	5d                   	pop    %ebp
  801cbd:	c3                   	ret    
  801cbe:	66 90                	xchg   %ax,%ax

00801cc0 <__udivdi3>:
  801cc0:	f3 0f 1e fb          	endbr32 
  801cc4:	55                   	push   %ebp
  801cc5:	57                   	push   %edi
  801cc6:	56                   	push   %esi
  801cc7:	53                   	push   %ebx
  801cc8:	83 ec 1c             	sub    $0x1c,%esp
  801ccb:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801ccf:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801cd3:	8b 74 24 34          	mov    0x34(%esp),%esi
  801cd7:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801cdb:	85 d2                	test   %edx,%edx
  801cdd:	75 19                	jne    801cf8 <__udivdi3+0x38>
  801cdf:	39 f3                	cmp    %esi,%ebx
  801ce1:	76 4d                	jbe    801d30 <__udivdi3+0x70>
  801ce3:	31 ff                	xor    %edi,%edi
  801ce5:	89 e8                	mov    %ebp,%eax
  801ce7:	89 f2                	mov    %esi,%edx
  801ce9:	f7 f3                	div    %ebx
  801ceb:	89 fa                	mov    %edi,%edx
  801ced:	83 c4 1c             	add    $0x1c,%esp
  801cf0:	5b                   	pop    %ebx
  801cf1:	5e                   	pop    %esi
  801cf2:	5f                   	pop    %edi
  801cf3:	5d                   	pop    %ebp
  801cf4:	c3                   	ret    
  801cf5:	8d 76 00             	lea    0x0(%esi),%esi
  801cf8:	39 f2                	cmp    %esi,%edx
  801cfa:	76 14                	jbe    801d10 <__udivdi3+0x50>
  801cfc:	31 ff                	xor    %edi,%edi
  801cfe:	31 c0                	xor    %eax,%eax
  801d00:	89 fa                	mov    %edi,%edx
  801d02:	83 c4 1c             	add    $0x1c,%esp
  801d05:	5b                   	pop    %ebx
  801d06:	5e                   	pop    %esi
  801d07:	5f                   	pop    %edi
  801d08:	5d                   	pop    %ebp
  801d09:	c3                   	ret    
  801d0a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801d10:	0f bd fa             	bsr    %edx,%edi
  801d13:	83 f7 1f             	xor    $0x1f,%edi
  801d16:	75 48                	jne    801d60 <__udivdi3+0xa0>
  801d18:	39 f2                	cmp    %esi,%edx
  801d1a:	72 06                	jb     801d22 <__udivdi3+0x62>
  801d1c:	31 c0                	xor    %eax,%eax
  801d1e:	39 eb                	cmp    %ebp,%ebx
  801d20:	77 de                	ja     801d00 <__udivdi3+0x40>
  801d22:	b8 01 00 00 00       	mov    $0x1,%eax
  801d27:	eb d7                	jmp    801d00 <__udivdi3+0x40>
  801d29:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d30:	89 d9                	mov    %ebx,%ecx
  801d32:	85 db                	test   %ebx,%ebx
  801d34:	75 0b                	jne    801d41 <__udivdi3+0x81>
  801d36:	b8 01 00 00 00       	mov    $0x1,%eax
  801d3b:	31 d2                	xor    %edx,%edx
  801d3d:	f7 f3                	div    %ebx
  801d3f:	89 c1                	mov    %eax,%ecx
  801d41:	31 d2                	xor    %edx,%edx
  801d43:	89 f0                	mov    %esi,%eax
  801d45:	f7 f1                	div    %ecx
  801d47:	89 c6                	mov    %eax,%esi
  801d49:	89 e8                	mov    %ebp,%eax
  801d4b:	89 f7                	mov    %esi,%edi
  801d4d:	f7 f1                	div    %ecx
  801d4f:	89 fa                	mov    %edi,%edx
  801d51:	83 c4 1c             	add    $0x1c,%esp
  801d54:	5b                   	pop    %ebx
  801d55:	5e                   	pop    %esi
  801d56:	5f                   	pop    %edi
  801d57:	5d                   	pop    %ebp
  801d58:	c3                   	ret    
  801d59:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d60:	89 f9                	mov    %edi,%ecx
  801d62:	b8 20 00 00 00       	mov    $0x20,%eax
  801d67:	29 f8                	sub    %edi,%eax
  801d69:	d3 e2                	shl    %cl,%edx
  801d6b:	89 54 24 08          	mov    %edx,0x8(%esp)
  801d6f:	89 c1                	mov    %eax,%ecx
  801d71:	89 da                	mov    %ebx,%edx
  801d73:	d3 ea                	shr    %cl,%edx
  801d75:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801d79:	09 d1                	or     %edx,%ecx
  801d7b:	89 f2                	mov    %esi,%edx
  801d7d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801d81:	89 f9                	mov    %edi,%ecx
  801d83:	d3 e3                	shl    %cl,%ebx
  801d85:	89 c1                	mov    %eax,%ecx
  801d87:	d3 ea                	shr    %cl,%edx
  801d89:	89 f9                	mov    %edi,%ecx
  801d8b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801d8f:	89 eb                	mov    %ebp,%ebx
  801d91:	d3 e6                	shl    %cl,%esi
  801d93:	89 c1                	mov    %eax,%ecx
  801d95:	d3 eb                	shr    %cl,%ebx
  801d97:	09 de                	or     %ebx,%esi
  801d99:	89 f0                	mov    %esi,%eax
  801d9b:	f7 74 24 08          	divl   0x8(%esp)
  801d9f:	89 d6                	mov    %edx,%esi
  801da1:	89 c3                	mov    %eax,%ebx
  801da3:	f7 64 24 0c          	mull   0xc(%esp)
  801da7:	39 d6                	cmp    %edx,%esi
  801da9:	72 15                	jb     801dc0 <__udivdi3+0x100>
  801dab:	89 f9                	mov    %edi,%ecx
  801dad:	d3 e5                	shl    %cl,%ebp
  801daf:	39 c5                	cmp    %eax,%ebp
  801db1:	73 04                	jae    801db7 <__udivdi3+0xf7>
  801db3:	39 d6                	cmp    %edx,%esi
  801db5:	74 09                	je     801dc0 <__udivdi3+0x100>
  801db7:	89 d8                	mov    %ebx,%eax
  801db9:	31 ff                	xor    %edi,%edi
  801dbb:	e9 40 ff ff ff       	jmp    801d00 <__udivdi3+0x40>
  801dc0:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801dc3:	31 ff                	xor    %edi,%edi
  801dc5:	e9 36 ff ff ff       	jmp    801d00 <__udivdi3+0x40>
  801dca:	66 90                	xchg   %ax,%ax
  801dcc:	66 90                	xchg   %ax,%ax
  801dce:	66 90                	xchg   %ax,%ax

00801dd0 <__umoddi3>:
  801dd0:	f3 0f 1e fb          	endbr32 
  801dd4:	55                   	push   %ebp
  801dd5:	57                   	push   %edi
  801dd6:	56                   	push   %esi
  801dd7:	53                   	push   %ebx
  801dd8:	83 ec 1c             	sub    $0x1c,%esp
  801ddb:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801ddf:	8b 74 24 30          	mov    0x30(%esp),%esi
  801de3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801de7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801deb:	85 c0                	test   %eax,%eax
  801ded:	75 19                	jne    801e08 <__umoddi3+0x38>
  801def:	39 df                	cmp    %ebx,%edi
  801df1:	76 5d                	jbe    801e50 <__umoddi3+0x80>
  801df3:	89 f0                	mov    %esi,%eax
  801df5:	89 da                	mov    %ebx,%edx
  801df7:	f7 f7                	div    %edi
  801df9:	89 d0                	mov    %edx,%eax
  801dfb:	31 d2                	xor    %edx,%edx
  801dfd:	83 c4 1c             	add    $0x1c,%esp
  801e00:	5b                   	pop    %ebx
  801e01:	5e                   	pop    %esi
  801e02:	5f                   	pop    %edi
  801e03:	5d                   	pop    %ebp
  801e04:	c3                   	ret    
  801e05:	8d 76 00             	lea    0x0(%esi),%esi
  801e08:	89 f2                	mov    %esi,%edx
  801e0a:	39 d8                	cmp    %ebx,%eax
  801e0c:	76 12                	jbe    801e20 <__umoddi3+0x50>
  801e0e:	89 f0                	mov    %esi,%eax
  801e10:	89 da                	mov    %ebx,%edx
  801e12:	83 c4 1c             	add    $0x1c,%esp
  801e15:	5b                   	pop    %ebx
  801e16:	5e                   	pop    %esi
  801e17:	5f                   	pop    %edi
  801e18:	5d                   	pop    %ebp
  801e19:	c3                   	ret    
  801e1a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801e20:	0f bd e8             	bsr    %eax,%ebp
  801e23:	83 f5 1f             	xor    $0x1f,%ebp
  801e26:	75 50                	jne    801e78 <__umoddi3+0xa8>
  801e28:	39 d8                	cmp    %ebx,%eax
  801e2a:	0f 82 e0 00 00 00    	jb     801f10 <__umoddi3+0x140>
  801e30:	89 d9                	mov    %ebx,%ecx
  801e32:	39 f7                	cmp    %esi,%edi
  801e34:	0f 86 d6 00 00 00    	jbe    801f10 <__umoddi3+0x140>
  801e3a:	89 d0                	mov    %edx,%eax
  801e3c:	89 ca                	mov    %ecx,%edx
  801e3e:	83 c4 1c             	add    $0x1c,%esp
  801e41:	5b                   	pop    %ebx
  801e42:	5e                   	pop    %esi
  801e43:	5f                   	pop    %edi
  801e44:	5d                   	pop    %ebp
  801e45:	c3                   	ret    
  801e46:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e4d:	8d 76 00             	lea    0x0(%esi),%esi
  801e50:	89 fd                	mov    %edi,%ebp
  801e52:	85 ff                	test   %edi,%edi
  801e54:	75 0b                	jne    801e61 <__umoddi3+0x91>
  801e56:	b8 01 00 00 00       	mov    $0x1,%eax
  801e5b:	31 d2                	xor    %edx,%edx
  801e5d:	f7 f7                	div    %edi
  801e5f:	89 c5                	mov    %eax,%ebp
  801e61:	89 d8                	mov    %ebx,%eax
  801e63:	31 d2                	xor    %edx,%edx
  801e65:	f7 f5                	div    %ebp
  801e67:	89 f0                	mov    %esi,%eax
  801e69:	f7 f5                	div    %ebp
  801e6b:	89 d0                	mov    %edx,%eax
  801e6d:	31 d2                	xor    %edx,%edx
  801e6f:	eb 8c                	jmp    801dfd <__umoddi3+0x2d>
  801e71:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e78:	89 e9                	mov    %ebp,%ecx
  801e7a:	ba 20 00 00 00       	mov    $0x20,%edx
  801e7f:	29 ea                	sub    %ebp,%edx
  801e81:	d3 e0                	shl    %cl,%eax
  801e83:	89 44 24 08          	mov    %eax,0x8(%esp)
  801e87:	89 d1                	mov    %edx,%ecx
  801e89:	89 f8                	mov    %edi,%eax
  801e8b:	d3 e8                	shr    %cl,%eax
  801e8d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801e91:	89 54 24 04          	mov    %edx,0x4(%esp)
  801e95:	8b 54 24 04          	mov    0x4(%esp),%edx
  801e99:	09 c1                	or     %eax,%ecx
  801e9b:	89 d8                	mov    %ebx,%eax
  801e9d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801ea1:	89 e9                	mov    %ebp,%ecx
  801ea3:	d3 e7                	shl    %cl,%edi
  801ea5:	89 d1                	mov    %edx,%ecx
  801ea7:	d3 e8                	shr    %cl,%eax
  801ea9:	89 e9                	mov    %ebp,%ecx
  801eab:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801eaf:	d3 e3                	shl    %cl,%ebx
  801eb1:	89 c7                	mov    %eax,%edi
  801eb3:	89 d1                	mov    %edx,%ecx
  801eb5:	89 f0                	mov    %esi,%eax
  801eb7:	d3 e8                	shr    %cl,%eax
  801eb9:	89 e9                	mov    %ebp,%ecx
  801ebb:	89 fa                	mov    %edi,%edx
  801ebd:	d3 e6                	shl    %cl,%esi
  801ebf:	09 d8                	or     %ebx,%eax
  801ec1:	f7 74 24 08          	divl   0x8(%esp)
  801ec5:	89 d1                	mov    %edx,%ecx
  801ec7:	89 f3                	mov    %esi,%ebx
  801ec9:	f7 64 24 0c          	mull   0xc(%esp)
  801ecd:	89 c6                	mov    %eax,%esi
  801ecf:	89 d7                	mov    %edx,%edi
  801ed1:	39 d1                	cmp    %edx,%ecx
  801ed3:	72 06                	jb     801edb <__umoddi3+0x10b>
  801ed5:	75 10                	jne    801ee7 <__umoddi3+0x117>
  801ed7:	39 c3                	cmp    %eax,%ebx
  801ed9:	73 0c                	jae    801ee7 <__umoddi3+0x117>
  801edb:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801edf:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801ee3:	89 d7                	mov    %edx,%edi
  801ee5:	89 c6                	mov    %eax,%esi
  801ee7:	89 ca                	mov    %ecx,%edx
  801ee9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801eee:	29 f3                	sub    %esi,%ebx
  801ef0:	19 fa                	sbb    %edi,%edx
  801ef2:	89 d0                	mov    %edx,%eax
  801ef4:	d3 e0                	shl    %cl,%eax
  801ef6:	89 e9                	mov    %ebp,%ecx
  801ef8:	d3 eb                	shr    %cl,%ebx
  801efa:	d3 ea                	shr    %cl,%edx
  801efc:	09 d8                	or     %ebx,%eax
  801efe:	83 c4 1c             	add    $0x1c,%esp
  801f01:	5b                   	pop    %ebx
  801f02:	5e                   	pop    %esi
  801f03:	5f                   	pop    %edi
  801f04:	5d                   	pop    %ebp
  801f05:	c3                   	ret    
  801f06:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801f0d:	8d 76 00             	lea    0x0(%esi),%esi
  801f10:	29 fe                	sub    %edi,%esi
  801f12:	19 c3                	sbb    %eax,%ebx
  801f14:	89 f2                	mov    %esi,%edx
  801f16:	89 d9                	mov    %ebx,%ecx
  801f18:	e9 1d ff ff ff       	jmp    801e3a <__umoddi3+0x6a>
